JUST hours before it was set to go into effect at the stroke of midnight on March 16th, Donald Trump’s second try at an executive order to pause travel from several Muslim-majority countries was batted down by a federal district court in Hawaii. Judge Derrick Watson, nominated to the bench by Barack Obama and confirmed unanimously by the Senate in 2013, was unimpressed with Mr Trump’s attempt to immunise his revised ban from its illicit discriminatory origin. The 43-page order did not mince words. “The illogic of the Government’s contentions”, Mr Watson wrote, “is palpable”.

The judge began by noting that the new ban differed in certain respects from the first. Travel restrictions on America’s lawful permanent residents and on people already holding visas abroad were lifted. Language suggesting that Christian refugees would be favoured over Muslims was deleted. And Iraq was removed from the list of banned countries, leaving six: Iran, Libya, Somalia, Sudan, Syria and Yemen. But Mr Watson wrote that the plaintiffs made a good case for their claim that the heart of Mr Trump’s order—a 90-day suspension of all travel from those countries, and a 120-day pause on the entry of new refugees—amounted to religious discrimination against Muslims. On this basis, Mr Watson issued a temporary restraining order on Mr Trump’s ban that applies nationwide. Until a full trial can be held on the matter—or until a higher court lifts the order—the president’s travel ban remains stymied.

It has been a little over a month since a judge in Washington state blocked Mr Trump’s first ban, a decision that was upheld unanimously by a three-judge panel at the Ninth Circuit Court of Appeals. This time around, the constitutional analysis shifted from due-process rights under the Fourteenth Amendment to the rule in the First Amendment barring the government from “establishing” religion or discriminating against certain faiths. Mr Watson scoffed at the Trump administration’s claim that the order’s “religiously neutral text”—and its inapplicability to 44 of the “world’s 50 Muslim-majority nations”—are saving graces. “The notion that one can demonstrate animus towards any group of people only by targeting all of them at once”, Mr Watson wrote, “is fundamentally flawed”. The judge then cited several statements by Mr Trump’s advisers to show that the revised ban was, in effect, the same wine in a slightly gussied-up wineskin. He recited the plaintiff’s citation of Stephen Miller’s appearance on Fox News when Mr Miller, a senior adviser to Mr Trump, said the second ban promised the “same basic policy outcome for the country” as its judicially addled predecessor.

On Wednesday evening, Donald Trump did himself few favours when he vented about the ruling before a raucous crowd in Nashville, Tennessee. Mr Trump vowed to “fight this terrible ruling”, if necessary, “all the way to the Supreme Court”. But he then—candidly but counter-productively—called the March 6th order “a watered-down version of the first order” issued on January 27th. He repeated this characterisation of the ban two more times, adding “I think we ought to go back to the first one”. Given the Justice Department’s defence of the revised ban as a new policy wiped clean of all legal infirmities, Mr Trump’s acknowledgement that it is simply a somewhat milder form of the first is more than impolitic. It could be added to the list of Mr Trump’s statements demonstrating the anti-Muslim pedigree of the travel restrictions.

The fate of Mr Trump’s central campaign promise is far from sealed. The next step is likely the Ninth Circuit Court of Appeals, the same tribunal that rebuked his executive order the first time around and that is likely to deal him a similar blow once again. If Mr Trump then asks the US Supreme Court to weigh in, his chances depend on timing. With the current line-up of eight justices, the travel ban seems doomed. But Judge Neil Gorsuch’s Senate hearings for a seat on the high court begin on March 20th, and he could slide into the late Justice Antonin Scalia’s old chair by mid-April. This would return the Supreme Court to a 5-4 majority of Republican-nominated justices and sets the stage for a dramatic showdown over Mr Trump’s assertions of executive power.

As it happens, neither Mr Gorsuch nor the four conservative justices on the Supreme Court think much of Lemon v Kurtzman, the main case Mr Watson relied upon in deciding that the travel ban is discriminatory on religious grounds. In a case from 2009, Mr Gorsuch noted that lower courts had “jettison[ed]” Lemon while the Supreme Court itself “seemed to eschew it” in its rulings on the constitutionality of Ten Commandments displays. Whereas Mr Watson leans on Lemon to show that a “reasonable observer” would detect the anti-Muslim spirit in Mr Trump’s executive order—based in part on his inflammatory rhetoric from the campaign trail—Mr Gorsuch sees a line between public officials speaking officially and in their “private capacity”. This less expansive reading of the Establishment Clause, coupled with a long history of judicial deference towards presidents on matters of immigration and foreign policy, gives Mr Trump some cause for hope.