WASHINGTON ― Customs officials violated a federal court order if they intentionally blocked lawyers from reaching detainees while enforcing President Donald Trump’s temporary travel ban last month, the top watchdog for the Department of Homeland Security said Wednesday.

If U.S. Customs and Border Protection officers knowingly violated a court order, that “would be, in my view, misconduct,” said DHS Inspector General John Roth, a former federal prosecutor who assumed his post under the Obama administration.

On Jan. 28, a federal judge in Virginia ordered CBP officers at Washington Dulles International Airport to allow legal permanent residents they were holding under Trump’s order to access attorneys. But border protection officials did not admit the lawyers who showed up. Detainees reportedly received contact information for other attorneys, but it’s unclear whether they could reach them. And when members of Congress showed up to enforce the court order, they couldn’t speak with CBP officials.

This decision risked triggering a constitutional crisis. Government officials are supposed to obey lawful court orders from judges, even if they don’t agree with them.

Roth was responding to a description of events provided by Sen. Cory Booker (D-N.J.), who went to Dulles airport after the court issued the order. CBP officials turned members of Congress away, The Daily Beast and The Huffington Post confirmed. DHS did not immediately respond to a request for comment.

At the Senate Committee on Commerce, Science and Transportation hearing on Wednesday, Booker said that he arrived with the judge’s order in hand, and showed it to CBP officials.

Booker asked Roth if he agreed that if CBP officials were aware of a court order and failed to comply, the order “factually was violated.” Roth said he agreed.

“That’s my understanding as a lawyer. Obviously, it would have to be intentional,” he said. “That is, knowing in fact that a court order existed and then choosing not to follow that court order. I think that’s correct.”

Virginia has asked a judge to force the Trump administration to prove why officials should not be held in contempt of court for disobeying the order at Dulles. Key parts of Trump’s executive order are currently suspended nationwide while the ban is being challenged in court.

Roth’s office has opened an inquiry into the Trump administration’s rollout of the travel ban, which suspends refugee resettlement for 120 days, bans Syrian refugees indefinitely and temporarily bars individuals from seven Muslim-majority countries. The probe will look at systemic issues — “who knew what when,” Roth explained on Wednesday — as well as potential misconduct.

Roth noted that while inspectors general don’t impose disciplinary measures, they may turn their findings over to CBP or to the U.S. Attorney’s Office and the Justice Department “if there’s a clear violation of law.”

How will Trump’s first 100 days impact you? Sign up for our weekly newsletter and get breaking updates on Trump’s presidency by messaging us here.