When a federal judge in issued an emergency order Sunday telling U.S. Customs and Border Protection officials at Los Angeles International Airport to allow an Iranian man to enter the country, immigration attorneys swung into action.

They grabbed the order from the judge's downtown L.A. courtroom and headed to the airport, where frenzied families and angry protestors had descended on the Tom Bradley International Terminal.

Attorneys had sought the order for Ali Khoshbakhti Vayeghan after he was detained and sent back to Dubai under President Trump’s temporary ban, which kept people from seven Muslim-majority nations from entering the U.S. That ban was blocked by a New York judge on Saturday but Vayeghan, 52, was already on a plane.

Vayeghan, whose son is a U.S. citizen, holds a valid visa and a green card, according to his attorney. He was planning on moving permanently to the U.S.

Why did attorneys rush to LAX to serve notice to U.S. customs officials when Vayeghan was already deported? (The judge’s order had also been sent to government attorneys via the court’s electronic filing service.) They wanted to make sure customs officials at the airport got word of the order and carried it out as soon as possible. They also planned to formally serve LAX customs officers with the nationwide halt to Trump’s order so that nobody else would be sent out of the U.S.

But when attorney Faith Nouri tried to give the notices to customs officials late Sunday, she said, she was turned away.

“They would not accept the order. They told me to go to the U.S. Marshals Service,” Nouri said.

Customs did not return KPCC’s phone calls and emails requesting comment. The agency has said nothing about its operations at LAX since Trump issued his executive order Friday, refusing to say how many people officers have detained and how many they’ve deported.

It should be noted that serving legal notices like this is common. This is how the legal system works. For instance, when a city asks a judge to issue a temporary restraining order blocking police officers from going on strike, city officials themselves may serve notice of the order to the police union.

In some cases, federal judges will order the U.S. Marshals to deliver and enforce orders. That’s what happened with the New York ruling — the first to block Trump.

“It is further ordered that to assure compliance with the Court’s order, the Court directs service of this Order upon the United States Marshal for the Eastern District of New York, and further directs the United States Marshals Service to take those actions deemed necessary to enforce the provisions and prohibitions set forth in this Order,” wrote U.S. District Judge Ann M. Donnelly.

The ruling involved a class action lawsuit and therefore was effective across the country. But marshals only needed to serve it to customs officers in the Eastern District of New York where the suit was brought.

In the other order involving Vayeghan, U.S. District Judge Dolly Gee in Los Angeles did not specifically ask marshals to deliver the order.

On Monday, immigration attorneys went to the U.S. Marshals Service office in downtown L.A. to ask the agency to serve notice on local customs officials. But a representative refused, according to attorney Laura Riley. She told KPCC that she and two other attorneys spent nearly all day in the marshals office at the federal courthouse in downtown LA. When a marshals official suggested they try serving the notices to a lawyer with the U.S. Attorney’s office, they rushed to another federal building eight blocks away. No luck, said Riley.

“It’s kind of harkening back to the 1950s and orders for schools to desegregate,” said Loyola Law School Professor Allan Ides. “Back then, some government officers were doing their best to avoid the orders and refuse to obey the orders.”

“To me, it's leading to a constitutional crisis,” he added.

The Marshals Service is part of the executive branch of government. They work, essentially, for President Trump. But by law, marshals are also the enforcement arm of the federal courts.

So when a federal judge rules that an action by the Trump administration violates the law, it is easy to see how that would put the service in an awkward position. The Marshals Service said as much in a statement released to KPCC.

“The U.S. Marshals Service will take steps to comply with all federal judicial orders while working with our Executive Branch partners who are implementing the President’s executive orders.”

But Ides has little sympathy for the service.

“I don’t understand the dilemma of the Marshals Service is,” he said. “They’re not being asked to defy Trump. They are being asked to serve an order. And they shouldn’t care what the content of the order is.”

So despite the judge’s order, Vayeghan’s future is uncertain, said his attorneys. Customs officials have said nothing about what they plan to do, said Vayeghan’s attorney Megan Brewer.

“There is a lack of transparency,” Brewer told KPCC. “They have processes behind the scenes that they are not letting us know what the details of those processes are.”

“Based on their behavior so far, it’s uncertain how they will view their obligation to comply with any of these orders."

*This story has been updated