In a scathing dissent on Tuesday, Sotomayor said the court’s majority, led by Chief Justice John Roberts, blindly accepted the government’s misguided invitation to set aside problematic comments Trump made before and after taking office.

“Ultimately, what began as a policy explicitly ‘calling for a total and complete shutdown of Muslims entering the United States’ has since morphed into a ‘Proclamation’ putatively based on national-security concerns,” she said. “But this new window dressing cannot conceal an unassailable fact: the words of the President and his advisers create the strong perception that the Proclamation is contaminated by impermissible discriminatory animus against Islam and its followers.”

Sotomayor described in detail how Trump pledged on the campaign trail to ban Muslims from entering the U.S. and then criticized the Department of Justice for submitting a “watered down, politically correct version” after the president's first order was struck down by the courts after he took office.

“People, the lawyers and the courts can call it whatever they want, but I am calling it what we need and what it is, a TRAVEL BAN!” Trump tweeted last June.

Sotomayor also said Trump has never disavowed any of his prior statements about Islam.

“Instead, he has continued to make remarks that a reasonable observer would view as an unrelenting attack on the Muslim religion and its followers,” she said. “Given President Trump’s failure to correct the reasonable perception of his apparent hostility toward the Islamic faith, it is unsurprising that the President’s lawyers have, at every step in the lower courts, failed in their attempts to launder the Proclamation of its discriminatory taint."

But in upholding the ban in a 5-4 ruling, Roberts said there was persuasive evidence that ban had a legitimate grounding in national security concerns and the court must accept that independent justification.

The ban, now in its third iteration, restricts nationals from five majority Muslim countries — Iran, Libya, Syria, Somalia and Yemen — from traveling to the U.S. Chad was also originally included, but the White House decided to drop it from the list in April.