Prime Minister Boris Johnson's decision to suspend Parliament less than two months before Britain is due to leave the European Union was unlawful, a Scottish court ruled Wednesday — though it said Britain's top court must make the final decision.

Judges at the Court of Session in Edinburgh said the government's action was illegal "because it had the purpose of stymieing Parliament."

The judges said the suspension was "null and of no effect," but referred the matter to Britain's Supreme Court for resolution. A hearing there is due to begin Tuesday.

After the ruling, opposition politicians urged the government to scrap the suspension and recall lawmakers to Parliament.

CHAOS IN UK PARLIAMENT AS SPEAKER PINNED TO SEAT, LAWMAKERS CHANT 'SHAME' AFTER BORIS JOHNSON SHUTDOWN

A group of about 70 opposition lawmakers challenged the government's decision to prorogue, or formally shut down, Parliament, for five weeks until Oct. 14 — just over two weeks before Britain is due to leave the EU.

Johnson claims he took the action so that he can start afresh on his domestic agenda at a new session of Parliament next month. But the suspension also gives him a respite from rebellious lawmakers as he plots his next move to break the political deadlock and lead Britain out of the EU by Oct. 31.

Britain's Prime Minister Boris Johnson visits Darnford Farm in Banchory near Aberdeen, Scotland, Friday Sept. 6, 2019, to coincide with the publication of Lord Bew's review and an announcement of extra funding for Scottish farmers. 

Britain's Prime Minister Boris Johnson visits Darnford Farm in Banchory near Aberdeen, Scotland, Friday Sept. 6, 2019, to coincide with the publication of Lord Bew's review and an announcement of extra funding for Scottish farmers.  (PA via AP)

BORIS JOHNSON TO SUSPEND PARLIAMENT AS BREXIT PLANS HIT SNAG

Opponents argue that Johnson is trying to evade democratic scrutiny.

Last week, a court in Edinburgh rejected the lawmakers' challenge, saying it was a matter for politicians, not the courts, to decide.

But that was overturned Wednesday on appeal.

Jolyon Maugham, a lawyer who is part of the claim, said he believed "that the effect of the decision is that Parliament is no longer prorogued."

It was unclear what that means in practice. Catherine Haddon, a senior fellow at independent think-tank the Institute for Government, tweeted that the ruling "does not (yet) change the prorogation itself. Though of course will add to pressure."

Labour Party Brexit spokesman Keir Starmer said the court's ruling was "very rare and it's very strong." He said the government should immediately recall Parliament.

The British government said it was disappointed by the decision and confirmed it would appeal to the Supreme Court.

In a statement, the government said it "needs to bring forward a strong domestic legislative agenda. Proroguing Parliament is the legal and necessary way of delivering this."

It noted that another challenge to the suspension, brought by transparency campaigner Gina Miller, was rejected at the High Court in London last week.

The court ruling deepens Britain's political deadlock, with Brexit due in about 50 days.

Johnson says the country must leave the EU on Oct. 31, with or without a divorce deal to smooth the way. But many lawmakers fear a no-deal Brexit would be economically devastating, and are determined to stop him.

Johnson says he wants to strike a new deal with the bloc after the agreement made by his predecessor Theresa May was rejected three times by Britain's Parliament. But EU officials say the U.K. has made no concrete proposals.

German Chancellor Angela Merkel said Wednesday that "it's my firm conviction that we still have a chance to achieve this in an orderly way."

CLICK HERE FOR THE FOX NEWS APP

But she told lawmakers in Berlin that Germany is also prepared for a Brexit without a deal that will result in "an economic competitor at our door."