Image copyright Reuters Image caption Outside the Supreme Court, opinions were all about Brexit

We keep having to say this about Brexit - we haven't seen anything like this before.

The Supreme Court of the United Kingdom has ruled that the government shut down Parliament illegally, just weeks away from the final Brexit deadline.

But what does this all mean? And why is this so significant?

This is about the impending Brexit deadline on 31 October.

Prime Minister Boris Johnson has vowed the UK will leave the EU on that day - even if there is no deal with the EU about how it will work.

But many lawmakers think a no-deal Brexit must be stopped at all costs.

So on 28 August, when Mr Johnson announced Parliament would be suspended until mid-October, a huge row erupted.

Mr Johnson said he was following normal procedure for a new leader. Rivals claimed he was trying to stop Parliament from opposing him.

The Supreme Court has decided he acted illegally - a ruling that challenges Britain's unwritten constitution and the entire balance of power.

The judges did not simply rule against the prime minister: this was the worst possible outcome for him.

He is already facing calls from political opponents to resign.

The court unanimously declared "the prime minister's advice to Her Majesty was unlawful, void and of no effect" when he asked the Queen to suspend Parliament.

The decision "had the effect of frustrating or preventing" Parliament from carrying out its functions, it said.

The court decided that the suspension of Parliament essentially never happened at all.

The UK's Supreme Court is just 10 years old, and the courts have, historically, not intervened in politics to this extent.

BBC legal correspondent Clive Coleman called it legal, constitutional and political dynamite - and said it was difficult to overestimate the significance of the ruling.

How do you close down a parliament?

The Supreme Court made clear it wasn't ruling on Brexit - but simply deciding if the prime minister could lawfully "prorogue" Parliament - a fancy word for suspending it.

It's not an unusual move: new prime ministers usually do that to end one session of Parliament and start another, with a new legislative programme. In recent decades, it's usually lasted a week. Mr Johnson consistently said that was all he was doing.

But he said the UK would leave the EU on 31 October no matter what - even if the controversial deal with the EU hadn't been agreed. That's hugely controversial, with members of Parliament (MPs) both in and out of his party worried that it would cause economic chaos.

After the summer break, there were just two months until the deadline – and then Mr Johnson suspended Parliament for an unusually long five weeks, until 14 October.

Chaos ensued.

What were the consequences of proroguing?

Inside Parliament, many of his own party members rebelled against him. More than 20 were expelled from the party. Some jumped ship to rivals. The prime minister's party lost its governing majority. Protests took place in the streets outside.

But in the end, Parliament closed, because the prime minister had asked the Queen to do so. That was within the law.

Or so everyone thought.

Legal challenges were filed arguing that the prime minister was acting for his own political gain - and that the whole thing was a ruse.

One court in England said the suspension was legal - but another in Scotland said the prime minister was trying to stop parliament holding his government to account.

And so the case landed in the Supreme Court.

Please upgrade your browser Your guide to Brexit jargon Enter the word or phrase you are looking for Search

What happened in court?

Part of the problem is that the UK doesn't have a written constitution like most other modern democracies. Instead, its constitution is based on hundreds of years of law and convention - which can be difficult to interpret.

A group of more than 70 parliamentarians, a vocal campaigner over Brexit, and a former prime minister were all arguing against the government.

There was plenty of colourful language.

Media playback is unsupported on your device Media caption The BBC's Clive Coleman takes a look inside the UK's Supreme Court

The lawyer for the Scottish group of MPs told the court it was about the "mother of parliaments closed down by the father of lies".

The government's lawyer told the judges that interfering would be "forbidden territory". He warned them they would be walking into an "ill-defined minefield".

In the end, the Supreme Court decided against the government.

What happens next?

Because the suspension was ruled unlawful, parliament is technically still in session, as if the whole thing never happened.

Boris Johnson, meanwhile, said that his government would respect the court's decision - even though he strongly disagreed with it.

The court said it was up to the Speaker of the House of Commons, John Bercow, and his counterpart in the House of Lords to decide what happened next, and they decided that both houses would reconvene on Wednesday.

And when it comes to Brexit, there's a time limit.

Media playback is unsupported on your device Media caption Mr Johnson refuses to rule out suspending Parliament again ahead of the judgement

The prime minister still maintains that he will take the UK out of the EU on 31 October - despite the fact that in the small amount of time they were in session, Parliament passed a law requiring him to ask for yet another extension.

He said that task was "not made much easier by this kind of stuff in Parliament or in the courts".

That disagreement could lead to another political crisis, or another election. Or the EU might not agree to an extension even if asked.

And now, more than three years after the Brexit vote, there are just 37 days left to sort it all out.