From the civil wars of the 17th century to the MPs expenses scandal of the last decade, the UK Supreme Court threw the kitchen sink at Boris Johnson in its reasoning that he had acted unlawfully.

It was no surprise the court reached back into the dusty scrolls of cases from the distant past to justify its view that it could hear a case involving the power of Royal Prerogative - "the King hath no prerogative, but that which the law of the land allows him" - a ruling from 1611.

But this very modern court also drew heavily on a case involving very modern phenomenon - sleaze.

In 2010 a group of MPs took a case to try and stop a prosecution for fiddling parliamentary expenses.

They argued that the matter was "in process" before parliament, so no other court could "impeach or question" the proceedings in parliament.

The Supreme Court rejected that argument, and today cited its own ruling as part of its devastating judgement on Boris Johnson's attempt to use prerogative power to suspend parliament.

Make no mistake about it, this is a stunning defeat for Prime Minister Johnson.

His whole strategy was to try to suspend parliament to get a clear five-week period in which he could try to negotiate some sort of a deal with the European Union without having interruptions - or as the parliament would see it - members doing their business of properly scrutinising the government and holding it to account during that period of suspension.

People I've spoken to cannot remember a time when a prime minister has been accused of acting unlawfully in his conduct in business and of basically misleading Queen Elizabeth.

They are speculating that no doubt her majesty will not be impressed by this situation at all - she's not sure whether she will be going to parliament to make a Queen's speech or not.

The parliament is going to resume its business tomorrow, according to Speaker John Bercow, who was at pains to point out it was a resumption, not a recall, as legally it had not been prorogued.

It is of course very embarrassing for the prime minister not just to have this judgement against him, but where he is when the judgement is being issued, at the United Nations in New York facing the glare of the world's media as well.

From going from a position where he wanted to have Brexit being discussed as quietly as it possibly could be, it has now exploded onto the global stage in the most embarrassing way possible.

He absolutely doesn't look good, his government doesn't look good, the parliament is starting to look a bit better, but the real star of today, undoubtedly, is the UK Supreme Court.

Look at some of the lines the judges used:

"This was not a normal prorogation in the run-up to a Queen's Speech ... This prolonged suspension of parliamentary democracy took place in quite exceptional circumstances: the fundamental change which was due to take place in the constitution of the United Kingdom on 31 October (Brexit). Parliament, and in particular the House of Commons as the elected representatives of the people, has a right to a voice in how that change comes about".

"The effect upon the fundamentals of our democracy was extreme," said Lady Brenda Hale, president of the Supreme Court. 

"The court is bound to conclude, therefore, that the decision to advise Her Majesty to prorogue parliament was unlawful because it had the effect of frustrating or preventing the ability of parliament to carry out its constitutional functions without reasonable justification".

"The prime minister’s advice to Her Majesty was unlawful, void and of no effect. This means that the order in council to which it led was also unlawful, void and of no effect and should be quashed. This means that when the Royal Commissioners walked into the House of Lords it was as if they walked in with a blank sheet of paper ... Parliament has not been prorogued. This is the unanimous judgment of all 11 justices".

It was devastating stuff. In ordinary times there would be little question that the prime minster would resign after an unprecedented ruling like that.

But these are not ordinary times. Mr Johnson remains in office and will fly back to London overnight to be ready to face parliament in the morning.

Will he face a confidence motion? It's the obvious question. But again, these are not ordinary times.

It doesn't appear to suit Labour, who have the key numbers needed to get a no-confidence motion though.

They want to use the recently passed Benn Act to force Mr Johnson to go to Brussels and ask for a Brexit extension. Then move to get an election, and implement their Brexit plan, which ultimately leads to another referendum.

Mr Johnson, no doubt, has other ideas on how this plays out.