Boris Johnson is bracing himself for a courtroom showdown over his controversial decision to suspend parliament in the run up to Brexit.
As the Supreme Court begins hearing arguments in the case, Sky News takes a look at how we got here and what could happen next…
Why has the government been taken to court?
At the end of last month, the prime minister moved to suspend parliament ahead of the opening of a new session.
That starts with a Queen’s Speech, which sets out the government’s legislative priorities.
Usually, such a move is dull and uncontroversial, and Mr Johnson has insisted he simply wants to suspend parliament so he can then set out his government’s agenda.
But his opponents were immediately suspicious, given that MPs and peers cannot formally debate policy and legislation and scrutinise the government during this time.
Prorogation (the fancier term for suspension) is normally for no longer than two weeks.
But the PM asked the Queen to approve a suspension of five weeks, much longer than usual.
Opponents were furious.
They believed the aim was to stop them examining Mr Johnson’s Brexit strategy and frustrate their efforts to prevent him taking Britain out of the EU on 31 October without a deal.
So they decided to fight it in the courts.
What have the courts decided so far?
A total of three legal challenges were launched.
The most noteworthy – and the reason why the battle is moving to the Supreme Court now – came in Scotland.
Three judges of the Inner House, the supreme civil court in Scotland, ruled the PM’s decision to suspend parliament was unlawful.
The case, brought by a cross-party group of 70 MPs, was originally dismissed at a lower court, the Court of Session.
There, Lord Doherty ruled it was for politicians and not the courts to decide on the issue.
But the MPs appealed – and last Wednesday the Inner House delivered its ruling.
Three judges concluded that prorogation had been done for “the purpose of stymying parliament”.
It added there were two “principal reasons” for Mr Johnson closing parliament.
First to “prevent or impede parliament holding the executive to account and legislating with regard to Brexit”.
And second to “allow the executive to pursue a policy of a no-deal Brexit without further parliamentary interference”.
It said the suspension of parliament was “unlawful and is thus null and of no effect”.
What else has been decided?
A similar case brought by the businesswoman and Brexit campaigner Gina Miller was heard at the High Court in London.
The judicial review application, which was supported by a number of other parties, wanted the judges to find that prorogation for an “exceptional” length of time was an “unlawful abuse of power”.
It was rejected, with the court ruling that suspending parliament was “inherently political in nature and there are no legal standards against which to judge the legitimacy”.
A third legal bid was launched by a Northern Ireland victims’ campaigner, who argued a no-deal Brexit would damage the peace process.
Raymond McCord’s challenge was dismissed by the High Court in Belfast.
So what happens now?
The Supreme Court in London – the highest court in the land – will hear the government’s appeal against the Scottish court decision.
A panel of 11 justices will consider the case, with a ruling expected later this week.
They are also expected to examine Ms Miller’s case, and the court may also consider the Belfast legal challenge.
The government has promised to respect the final result.
What happens if the government loses?
The PM would almost certainly have to advise the Queen to recall parliament immediately.
But the court could rule that parliament was never properly suspended and is still in session, meaning that there is no need to recall it.
Either way, it is likely parliament would have to return very quickly.
Raphael Hogarth, an associate at the Institute for Government, said: “If the Supreme Court rules… that the prorogation was unlawful, then I’d expect parliament to be sitting again in very short order.
“The mechanics of that depend on what the court says.”
Mr Johnson has rejected claims he lied to the Queen over the suspension, but a loss for the government would most likely mean calls for him to resign.
Whether the PM would bow to such pressure is debatable – and it may depend on what exactly the Supreme Court says.
What happens if the PM loses but he refuses to back down?
The Queen has the power to recall parliament through a proclamation, which Mr Johnson would be expected to advise her to do if the suspension is ruled to be unlawful.
If he doesn’t, the monarch would be in an awkward position.
The Queen is meant to be above politics, but she would be placed in the eye of an almighty political storm.