Sky News takes a look at how we got here, what has happened in the case so far – 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 earlier this month 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 now?
The Supreme Court in London – the highest court in the land – is hearing the government’s appeal against the Scottish court decision.
A panel of 11 justices is considering the case, along with Mrs Miller’s case, over the course of three days.
They are being asked to determine whether the PM’s advice to the Queen is “justiciable” – capable of challenge in the courts – and, if so, whether it was lawful.
It is not clear when the justices will give a ruling.
The government has promised to respect the final result.
What happened on the first day of the case?
Mr Johnson was accused of silencing MPs in a bid to avoid scrutiny over Brexit.
Lord Pannick, the lawyer representing Mrs Miller, said the prime minister wanted to “avoid parliamentary control”.
If he was really shutting the Commons just to follow the rules required for a new session, Lord Pannick said, Mr Johnson would have recommended a “shorter” period than five weeks.
He argued that the “exceptional” length of parliament’s suspension was “strong evidence” that the PM wants to “silence” MPs because he sees them as “obstacle to the furtherance of his political aims”.
On the afternoon of the first day, a government lawyer would not rule out Boris Johnson trying to close parliament for a second time.
Lord Keen QC outlined the government’s appeal against the Scottish court ruling.
The question of what the government will do if the Supreme Court rules against it was raised during proceedings.
Lord Keen said Mr Johnson would “take the necessary steps” to comply with the court’s ruling.
But when asked by Lord Kerr, one of the 11 justices, what would happen if the court rules that the prorogation was unlawful, and whether parliament would be recalled, he responded: “It will be then for the prime minister to address the consequences of that declaration.”
Lord Keen, Scotland’s advocate general, continued: “I have given a very clear undertaking that the prime minister will respond by all necessary means to any declaration that the… prorogation was affected by any unlawful advice that he may have given.”
Lord Kerr then asked if it was the case that parliament could not be prorogued for a second time.
“I’m not in a position to comment on that,” Lord Keen replied. “That will have to be addressed by the decision maker.”
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.