In a dramatic late-night decision, two federal judges in Boston on Sunday issued a temporary stay on a controversial executive order from President Trump.

The ruling puts a seven-day hold on enforcement of Trump's order, which, in part, blocked travelers from seven majority-Muslim countries (Iraq, Iran, Libya, Somalia, Sudan, Syria and Yemen).

According to the attorneys who pushed for the ruling, some aspects of the decision have nationwide effects, while other parts are local to Massachusetts.

The ruling, according to the attorneys, states that no approved refugee, holder of a valid visa, lawful permanent resident or traveler from the seven majority-Muslim nations can — for the next seven days — be detained or removed due solely to Trump's executive order anywhere in the United States.

The ruling also instructs Customs and Border Protection officials to notify international airlines that have flights to Logan Airport that individuals on those flights will not be detained or returned based solely on Trump's order. This, in effect, attempts to prevent passengers being barred from boarding international flights headed for Boston.

The temporary restraining order was issued just before 2 a.m. Sunday by Judge Allison Burroughs and Magistrate Judge Judith Dein on behalf of two lawful permanent residents detained at Logan.

"Its issuance is in the public interest," the judges wrote in granting the ruling.

The ACLU of Massachusetts called the stay "a huge victory for justice."

The Boston ruling followed a New York-based judge's stay on the deportations of valid visa holders after they have landed at a U.S. airport.

The Department of Homeland Security issued a statement early Sunday saying it "will continue to enforce all of President Trump’s Executive Orders in a manner that ensures the safety and security of the American people." The statement added, though, that the department "will comply with judicial orders."

On Saturday, at least three travelers were detained for extensive questioning upon landing at Logan Airport in response to Trump's executive order. Over the course of the evening, a group of protesters and civil rights lawyers gathered at the international arrivals terminal to call for the immediate release of the travelers, at least two of whom were lawful permanent residents of the U.S.

By 8:45 p.m., the crowd had grown so large that State Police closed vehicle access to the terminal. Inside, protesters chanted and held signs including "Refugees Welcome" and "Migration Is Beautiful."

Mazdak Tootkaboni, a UMass Dartmouth professor from Iran and a lawful permanent resident of the U.S., was returning from attending an academic conference in France along with his wife and fellow UMass Dartmouth professor, Arghavan Louhghalam, who is also an Iranian national and lawful permanent resident of the U.S.

Tootkaboni said he was pulled out of line while going through customs and was released after what he said was about a three hour process.

"We were just told that there was this new ruling in place that we had to go through this inspection and that was all," he said, while the crowd of protesters cheered his arrival. "So, they took the passport, they did an inspection, we had to just sit for awhile, I guess three hours, and that was it."

Tootkaboni, who appeared calm and was smiling when speaking with reporters, emphasized that he was treated respectfully by customs officials, though the whole ordeal was "humiliating." His family said they had not been informed during any part of the process and that they were relieved to be going home together.

Late Saturday night, Tootkaboni and Louhghalam's names were listed as petitioners on the proposed order issued by civil rights and immigration lawyers in Boston federal court.

Following the judges' ruling, lawyers from the ACLU of Massachusetts and the American Immigration Lawyers Association were somewhat split on its scope. Attorneys with AILA had said the ruling was "local to Massachusetts." Later, an attorney with AILA said that after consultation with other members of the legal team, the group does believe certain parts of the ruling have nationwide effects.

Ray Farquhar, chief of defensive litigation in the civil division of the Massachusetts U.S. attorney's office, said the government had no objections to the order issued by the federal judges.

Lawyers for the petitioners must file an amended order on Monday. There will be another hearing for that amended order within the next seven days.

Early Sunday, lawyers let out a collective cheer in the elevator while making their way down to the clerk's office to receive the official signed order. Copies were distributed and several members of the team were jumping up and down with excitement. The group posed for a photo before heading outside to address members of the press.

Click the audio player atop this post to hear Shannon's debrief on Weekend Edition.

Correction: An earlier version of this post referred to Customs and Border Protection as Customs and Border Patrol. We regret the error.