Citing a U.S. Supreme Court ruling in an Arizona case, a three-judge panel of the 5th Circuit Court of Appeals Tuesday upheld the so-called “show me your papers” provision of the Texas sanctuary cities law that allows police to inquire about the citizenship or legal resident status of people who are lawfully detained for violations of criminal or civil law. The court ruled that the law is constitutional because it does not require police to ask about residency. “It would be wrong to assume that SB4 (the sanctuary cities law) authorizes unreasonable conduct where the statute’s text does not require it,” the court wrote in its opinion.

The appeals court upheld a lower court ruling that a provision of the law that prohibits local governments from “endorsing” a policy contrary to federal immigration laws was unconstitutionally vague. The court ordered the trial court to hold further hearings on that provision but to vacate the remainder of the lawsuit.

In Arizona v. the United States, the U.S. Supreme Court ruled that the state of Arizona could allow state police to investigate the immigration status of individuals who had been legally detained or arrested if there was a reasonable suspicion that the person was in the country illegally. But Justice Anthony Kennedy went on to write that no individual could be detained for a prolonged period of time while their legal residence was established, and he wrote that nothing in the ruling would prevent lawsuits against law enforcement officers in cases of racial profiling.

The 5th Circuit opinion was written by Judge Edith Jones while Circuit Judges Jerry E. Smith and Edward C. Prado concurred. Jones and Smith were appointed to the court by President Ronald Reagan, while Prado was appointed by President George W. Bush. While their ruling ultimately will face additional appeals, it allows the “show me your papers” provision of the law to remain in effect for the time being. President Trump has been supporting Texas in the lawsuit.

Governor Greg Abbott, who signed Senate Bill 4 into law, declared victory after the court ruled.

Texas Attorney General Ken Paxton also tweeted his win in the case.