Texas Attorney General Ken Paxton has thrown his weight behind the Trump administration in its legal fight to restore the president’s travel ban. (Gabriella Demczuk/Getty Images)

The state of Texas on Wednesday threw its weight behind the Trump administration in the legal battle over the president’s executive order temporarily barring refugees and citizens of seven Muslim-majority countries from entering the United States, arguing in a court filing that Trump was well within his authority to stop certain foreigners from entering the country while officials reassess vetting procedures.

Republican Attorney General Ken Paxton urged the U.S. Court of Appeals for the 9th Circuit in an amicus brief to reconsider a decision by one of its three-judge panels to keep the travel ban frozen. His is the first state to come out in support of the ban in the court case; 21 have lined up on the other side, including Washington and Minnesota, which successfully sued to stop it.

“Like every other State in the Union, amicus has a significant interest in protecting its residents’ safety,” Paxton wrote. “But the State itself possesses no authority to set the terms and conditions of entry for aliens seeking to enter the United States, or to restrict the entry of such aliens for foreign-affairs, public-safety, or national-security reasons. Instead, the State relies on the federal Executive Branch to carry out that function, pursuant to the laws of Congress.”

For now, Trump’s travel ban remains frozen, and the president has said he is considering rewriting the executive order. Judges nationwide have ruled against him — most recently, a federal judge in Virginia issued a scathing opinion that confronted directly whether his order was legal — although the court battle is ongoing. The next big question is whether the 9th Circuit will consider the matter en banc and — if so — possibly end its own three-judge panel’s freeze on the ban.

Texas argued in its brief that the 9th Circuit should intervene and end “a remarkable use of the judicial power to interfere with the President’s national-security decisions in an area of strongest executive authority.” The state argued that Trump’s ban was not discriminatory, but, rather, grounded in real national security concerns.

The case already had attracted significant attention from outside interests. Attorneys general for California, Connecticut, Delaware, Illinois, Iowa, Maine, Maryland, Massachusetts, New Hampshire, New Mexico, New York, North Carolina, Oregon, Pennsylvania, Rhode Island, Vermont, Virginia and the District of Columbia urged the court to keep the ban frozen in another amicus brief, and the state of Hawaii, which has sued on its own, also asked to intervene.

Ten former high-ranking diplomatic and national security officials argued that there was “no national security purpose” for a complete barring of people from the seven affected countries, nearly 100 Silicon Valley tech companies argued that the ban could hurt their businesses.

Texas is no stranger to using the federal court system in immigration matters, although the last time around, it joined 25 other Republican-led states in suing to stop executive action by President Barack Obama. They were ultimately successful in that challenge, after a lower court decided that Obama probably had exceeded his powers and a deadlocked Supreme Court left that ruling undisturbed. Paxton at the time hailed the decision as keeping the president in check.

“Today’s decision keeps in place what we have maintained from the very start: One person, even a president, cannot unilaterally change the law,” he said. “This is a major setback to President Obama’s attempts to expand executive power and a victory for those who believe in the separation of powers and the rule of law.”

Read more:

Why Virginia matters in the travel ban fight

7 key takeaways from the court’s ruling on Trump’s immigration order