It took little more than a week in office for President Donald Trump to thrust the nation to the brink of a constitutional crisis.

Late Friday, Trump issued an executive order forbidding millions of refugees, hundreds of thousands of visitors and 500,000 legal immigrants from seven majority-Muslim countries from entering the United States. Over the following 48 hours, massive protests erupted in cities and airports nationwide, courts temporarily blocked major parts of the order, the administration defied the courts and Democrats called for an investigation into the administration’s defiance. As the weekend drew to a close, an anonymous White House official proclaimed the whole episode a “massive success story.”

The federal courts thought otherwise. On Saturday night, a judge in Brooklyn ordered the Trump administration to stop deporting refugees and visitors immigration authorities had previously cleared to enter the country. Two judges in Massachusetts ordered that travelers who were legally authorized to be in the United States shouldn’t be detained at or deported from Logan International Airport for a period of seven days. A judge in Seattle halted the deportation of two travelers. And a judge in Virginia issued an order requiring the administration to allow lawyers access to lawful permanent residents — also known as green card holders — whom Customs and Border Protection agents had detained at Dulles International Airport on Trump’s instructions.

When federal judges rule, government officials — up to and including the president — are supposed to obey or risk being held in contempt of court. A government that ignored the courts would be able to violate the law and the Constitution at will. So for more than two centuries, the nation’s courts have had the last word on what’s legal and constitutional — and what is not.

“We are and will remain in compliance with judicial orders,” the Department of Homeland Security said in a statement Sunday evening.

DHS added that it was working with airlines to prevent people it didn’t want to enter the U.S. from even boarding planes. Since the broadest federal court order only applied to people inside the U.S. or in transit, and since federal court orders generally don’t apply outside the U.S., this move will allow the administration to enforce the executive order as it chooses with less risk of flouting judicial directives. It’s not yet clear whether the Massachusetts judges’ order, which applied to people traveling through Logan International Airport in Boston, requires airlines to allow people affected by the executive order to board.

And over the weekend, at least, there was little indication that the Trump administration had fully complied with the court orders — or that Trump’s inner circle even believed the administration had to do so.

“Saturday’s ruling does not undercut the president’s executive order,” a senior White House official told NBC News midday Sunday in reference to the Brooklyn judge’s decision. “All stopped visas will remain stopped. All halted admissions will remain halted. All restricted travel will remain prohibited.”

Customs and Border Protection officials refused throughout the weekend to obey the Virginia judge’s order to allow lawyers access to detainees at Dulles. “It’s not going to happen,” they told attorneys who hoped to represent the detained people. When Sen. Cory Booker (D-N.J.) showed up at the airport shortly before midnight Saturday, CBP officials refused to meet with him, according to reporting by The Daily Beast’s Betsy Woodruff.

“I am now of the belief that though this was issued by the judicial branch, that it was violated tonight,” Booker said, brandishing the order. “And so one of the things I will be doing is fighting to make sure that the executive branch abides by the law as it was issued in this state and around the nation. This will be an ongoing battle ... I believe it’s a constitutional crisis, where the executive branch is not abiding by the law.”

The next morning, four Democratic members of the House of Representatives went to the airport and tried and failed to convince CBP to obey the order.