CNN  — 

The UK government’s decision to shut down Parliament in the run-up to Brexit was illegal, Scotland’s highest civil court has ruled, in a serious blow to embattled Prime Minister Boris Johnson.

In a devastating ruling, a panel of three senior judges unanimously declared that Johnson’s advice to the Queen to suspend Parliament for five weeks was “unlawful.”

Johnson has always insisted that his decision was a routine device that allowed the government to start a new parliamentary session with a fresh legislative agenda. But the Scottish judges disagreed, saying it was motivated by the “improper purpose of stymying Parliament.”

“This was an egregious case of a clear failure to comply with generally accepted standards of behaviour of public authorities,” ruled one of the judges, Lord Brodie, according to a summary of the decision posted online.

The court did not immediately issue an order to lift the suspension – also known as prorogation – noting that the High Court in London had come to a different conclusion and that the UK Supreme Court would need to resolve the issue. The government confirmed that it would appeal the Scottish court’s decision to the Supreme Court.

A protester holds a placard at the gates of Downing Street during a demonstration against the UK Government's decision to  prorogue parliament.

Joanna Cherry, a member of Parliament for the Scottish National Party, who was the lead petitioner in the cross-party group of politicians which brought the action, said the decision was a “historic ruling.”

Dominic Grieve, who was attorney general in the government of former Prime Minister Theresa May, said if it was established that Johnson had misled the Queen, he would have to resign.”If that were to to be the case that this had happened, Boris Johnson would find himself in an untenable position in Parliament,” he told the BBC.

Speaking to CNN, Labour MP Hillary Benn – one of the lawmakers leading the charge to seize control of the Brexit process – said Britain was “in a crisis” and called on the Prime Minister to recall Parliament.

“It’s of huge constitutional significance,” he said. “If they were to uphold, the Prime Minister will have to bring parliament back. Frankly, he should do it anyway. He should never have sent us away at a time of huge significance. We are in a crisis.”

Johnson held a so-called “People’s PMQs” on Facebook Live hours after the decision, but failed to directly refer to the ruling.

However, he did reject claims that he was anti-democratic, and said a Queen’s Speech is needed to “push on” with his domestic agenda. “That’s what the public, I think, want us to do.”

Advice to the Queen ruled unlawful

In their unexpected ruling on Wednesday, the Scottish judges overturned an earlier decision that the courts did not have the power to interfere in the Prime Minister’s political decision to prorogue parliament.