LOS ANGELES — A federal judge in Los Angeles has ordered the U.S. government to allow people holding immigrant visas from seven majority-Muslim nations into the United States despite President Trump’s executive order banning them.

In a temporary restraining order issued late Tuesday, Judge Andre Birotte Jr. ordered the government not to cancel any validly obtained immigrant visas or bar anyone from the seven nations holding them from entering the U.S.

But it was unclear whether the order will have any effect. The State Department ordered all visas from the seven countries revoked on Friday, and the government has maintained that orders similar to Birotte’s do not apply because the visas are no longer valid.

The State Department declined comment Wednesday on Birotte’s order, saying it does not comment on pending litigation.

Stacey Gartland, a San Francisco attorney who represents a 12-year-old Yemeni girl whose parents and siblings are U.S. citizens living in California, acknowledged Wednesday that her client and hundreds of others with immigrant visas still may not be allowed in the U.S. under Birotte’s order, but said she’s optimistic.

“This court order is a major victory and definitely gives us a path forward,” Gartland said. “It’s just a matter of getting it into the right hands of someone who’ll obey the court order.”

Julie Goldberg, the Los Angeles-based immigration lawyer who filed the lawsuit that prompted Birotte’s order, is trying to arrange flights for dozens of Yemeni citizens who have immigrant visas and are stranded in the tiny African nation of Djibouti, including the 12-year-old girl Gartland represents.

Gartland said two major airlines have turned them down but they are trying to work with smaller airlines that will follow the order.

“These are all children, parents and the spouses of U.S. citizens,” Goldberg told The Associated Press from the Horn of Africa nation, emphasizing that those stranded are not refugees, though Yemen is engulfed in civil war. They received visas last week, she said.

Meanwhile, officials in Washington announced Tuesday that legal permanent U.S. residents from the targeted countries won’t need special permission to come back to the United States after all.

White House spokesman Sean Spicer said green card holders will now be allowed to enter and leave the United States as they please, despite the ban. Spicer’s announcement was the latest effort to clarify and adjust Trump’s executive order banning travel and immigration from seven majority-Muslim countries.

The order, signed Friday, has caused drawn international criticism and spawned widespread panic among travelers and apparent confusion within the government about how the order should be implemented.