As tens of thousands protested across the United States, the Trump administration reversed itself late Sunday, announcing that the president’s executive order barring entry to citizens of seven, Muslim-majority nations no longer applies to more than 500,000 green card holders .

On Saturday, as officials scrambled to implement the hastily issued order, the agency’s acting spokeswoman told Reuters “it will bar green card holders” originally from those nations. Dozens of green-card holders, making them permanent legal residents of the United States, were detained at airports across the country, along with previously vetted refugees from the seven nations, prompting spontaneous protests.

“In applying the provisions of the president’s executive order, I hereby deem the entry of lawful permanent residents to be in the national interest,” John Kelly, the new head of the Department of Homeland Security said in a statement issued on Sunday evening.

“Accordingly, absent the receipt of significant derogatory information indicating a serious threat to public safety and welfare, lawful permanent resident status will be a dispositive factor in our case-by-case determinations,” Kelly added.

That Kelly’s statement came 10 hours after an earlier one, which made no mention of an exemption for those holding green cards, suggested that the policy was being crafted by discussions after, instead of before, Donald Trump issued the order.

For his part, Trump insisted that it was not accurate to call his ban on travel from the seven, Muslim-majority nations a “Muslim ban,” insisting that it was about preventing terrorism, even though not one American has been killed by a traveler from one of those nations.

That claim was also undermined by his adviser Rudy Giuliani boasting to Fox News that he had helped draw up the order after being asked by Trump how to make good on his campaign promise to impose, “a total and complete shutdown of Muslims entering the United States until our country’s representatives can figure out what the hell is going on.”