When Boris Johnson walked into his impromptu war room at New York's Westin Grand Central hotel, shortly after 5.30am on Tuesday, his weary staff were waiting for him. "It's a constitutional crisis," said one aide, still digesting the Supreme Court's explosive intervention in British politics.
The devastating judgment left Britain's prime minister accused of asking the Queen to act unlawfully in his name to suspend parliament for five weeks, leaving MPs unable to do their job in scrutinising Brexit. It was going to be a long day.
Johnson's team set up a "spiderphone" to connect back to London, where Geoffrey Cox, attorney-general, and Robert Buckland, justice secretary, had already trawled through the ruling, looking for chinks of light in the bleak text. There were none.
The prime minister's political strategy for delivering Brexit lay in disarray, pulled apart by parliament and now the courts. Humiliated and 3,500 miles from home — attending the UN General Assembly — Johnson's team began to work out what to do next.
The first decision was that Johnson would not resign, in spite of the setback and the implication that he had misled the monarch as to his real motives for proroguing parliament.
British officials said Johnson spoke to the Queen on Tuesday but declined to say whether he had apologised.
The second urgent decision was logistical. Johnson had been due to arrive back in Britain on Wednesday night but John Bercow, the House of Commons speaker, said MPs would reconvene at 11.30am that morning.
So the travel plan was shredded. Johnson would fly back to London overnight on Tuesday, arriving at Heathrow airport at 11am on Wednesday, just half an hour before the Commons resumes. Fresh from that red-eye flight, Johnson will be under pressure to make a statement to MPs.
The prime minister's team, normally bullish in their willingness to defy convention to deliver Brexit, agreed there was no option but to accept the ruling, in spite of Johnson's assertion that he "strongly disagreed" with it.
Johnson arrived at Hudson Yards, a former railway yard in Manhattan that is now a gleaming retail and commercial centre, on Tuesday morning looking weary but declaring: "Obviously this is a verdict that we will respect and we will respect the judicial process."
The prime minister's "do or die" strategy to leave the EU on October 31, without a deal if necessary, is now in tatters. The mastermind of this abrasive approach, Johnson's chief adviser and former Vote Leave campaign chief Dominic Cummings, is now being blamed by some Tory MPs for the mess.
First parliament passed a law forcing him to seek a delay to Brexit if no deal was in place.
Although Cummings anticipated this possibility, he did not expect Labour and other opposition parties to block his planned "people versus parliament" general election until the Brexit delay was agreed.
The immediate impact of the Supreme Court ruling is that any thoughts that Cummings might have had about another prorogation to force through a no-deal exit on October 31 while MPs were not sitting, now look fanciful. It would quickly end up in the courts again.
Although Downing Street said the option of closing down parliament again around October 31 was never being considered, Tory aides insisted that Cummings had told advisers: "If they stop this prorogation, we can prorogue again."
Johnson was already trapped, but the Supreme Court has effectively double-bolted all the doors. The choice facing the prime minister now is between striking a deal in Brussels on October 17-18 or seeking an extension to the Article 50 exit process — something he has vowed not to do.
The prime minister said on Tuesday he was serious about reaching an agreement, even though the UK and EU appear to be far apart. "Now is the chance for us to get a deal, come out of the EU on October 31 and that is what we are going to do," he told reporters.
Later in the day he has meeting with French president Emmanuel Macron, Germany chancellor Angela Merkel, EU Council president Donald Tusk and Ireland's taoiseach Leo Varadkar.
It is telling that Johnson brought with him to New York his chief Brexit negotiator, David Frost, and Edward Lister, his long-serving adviser who is playing an increasingly central role in trying to engineer a deal.
The return of parliament on Wednesday poses short-term problems for Johnson, who is considering whether to press ahead with his plan to hold a Queen's Speech on October 14, something which would require a formal prorogation between two parliamentary sessions.
"I do think there's a good case for getting on with a Queen's Speech anyway and we will do that," Johnson said at Hudson Yards. But his allies admit that going through a formal prorogation to enable a Queen's Speech would be painful and no decision had been taken.
Given that Tory MPs assume Johnson only planned a Queen's Speech for October 14 to give him an excuse for the botched five-week prorogation, the cabinet will debate whether it is wise to press ahead with a new legislative programme in such a febrile atmosphere.
Johnson will also have to decide whether to seek a short "conference recess" so that MPs are not sitting through next week's Conservative party conference in Manchester. Such a recess would have to be approved by MPs.
The Supreme Court ruling does not, however, alter Johnson's plan to push for a Brexit deal on October 17-18. New British proposals are expected to be published on October 3, immediately after the Tory conference ends.
Negotiations with the EU would then take place over a tight 10-day period, allowing diplomats to assess whether a deal can then be finalised at the summit a few days later. If a deal is done, parliament would have little more than 10 days to ratify it.
When Johnson does face the electorate, he will no doubt use the Supreme Court ruling as evidence that he stood up for the 52 per cent of voters who backed Leave against a Remain "establishment" of judges, MPs and a media elite.
But for the prime minister, contemplating a long flight back to London and political humiliation, it was a calamitous day. John Major, former Tory prime minister, concluded: "No prime minister must ever treat the monarch or parliament in this way again."