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.

“We have a constitutional crisis today,” Rep. Don Beyer (D-Va.), one of the four House members who went to the airport, tweeted Sunday.

We have a constitutional crisis today. Four Members of Congress asked CBP officials to enforce a federal court order and were turned away. — Rep. Don Beyer (@RepDonBeyer) January 29, 2017

”I am deeply disappointed by what happened at Dulles… and how the order was ignored,” Booker added later. “There must be accountability for this.”

I was deeply disappointed by what happened at Dulles last night and how the order was ignored. There must be accountability for this. https://t.co/ojG22CaOCT — Cory Booker (@CoryBooker) January 29, 2017

Detentions continued in California, too, according to the state’s junior senator.

“I have received reports from attorneys in CA that agents are continuing to deny or delay entry to America to visa holders and others,” Sen. Kamala Harris (D-Calif.) tweeted shortly before 8 p.m. Sunday. “This violates the federal court orders and it is imperative [Homeland Security Secretary John Kelly] ensures all staff are notified and comply with the law.”

On Sunday night, Sens. Tammy Duckworth (D-Ill.) and Richard Durbin (Ill.), the second-highest-ranking Democrat in the Senate, sent a letter to the Department of Homeland Security’s inspector general requesting an investigation into the agency’s handling of Trump’s executive order and response to the court rulings. The senators asked the IG to figure out whether any CBP officers disobeyed court orders, what they did, and who ordered them to do it.

“The United States Constitution means little if law enforcement agents disregard it,” Duckworth and Durbin wrote. “The American people are relying on your independent investigators to serve as a check against a powerful law enforcement agency that may be ... operating in violation of the law.”

The weekend’s events had all the makings of a constitutional crisis, two law professors told HuffPost.

Disobeying a court order “is a big deal for any government official — federal, state, local, executive, legislative, whatever,” said Abner Greene, a law professor at Fordham University. “Obedience to specific court orders is what keeps us from being a banana republic or fascist dictatorship. That’s a really big deal.”

The chaos “doesn’t just risk a constitutional crisis,” argued Michael Dorf, a professor at Cornell Law School. “Assuming the report is accurate, it creates one.” If the Trump administration believes that the court orders limiting the president’s executive order are unlawful, it can file an emergency appeal, Dorf noted. But “outright defiance,” he added, “can only be deemed disrespect for the rule of law.”

Sign up for the HuffPost Must Reads newsletter. Each Sunday, we will bring you the best original reporting, long form writing and breaking news from The Huffington Post and around the web, plus behind-the-scenes looks at how it’s all made. Click here to sign up!