A British court on Wednesday ruled that Prime Minister Boris Johnson’s controversial shutdown of Parliament is unlawful — but still did not overturn it.

Judges at the Court of Session in Scotland said the government’s action was illegal “because it had the purpose of stymieing Parliament” in the crucial lead-up to the Brexit deadline on Oct. 31.

The three judges said the suspension was “null and of no effect” — but referred the final decision to Britain’s Supreme Court, which will start hearing the case next Tuesday.

A spokesman for Johnson’s government said, “We are disappointed by today’s decision, and will appeal to the UK supreme court.”

Parliament was prorogued, the formal term for the suspension, from Monday night, with MPs to return on Oct. 14 — just over two weeks before Britain is due to leave the EU.

Opposition MPs on Wednesday immediately called for Parliament to be recalled. Labour Party Brexit spokesman Keir Starmer said the court’s ruling was “very rare and it’s very strong.”

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.”

“That said, given the mood in Parliament, I would not put it past any MPs to turn up to work and try and test the judgement,” she said in another tweet.

The ruling came as a new poll showed that more than half of British adults believe the result of the 2016 referendum should be respected, and Brexit delivered, according to The Telegraph.

The poll by ComRes showed 54 percent want the referendum result to leave to be respected — with 35 percent of those who originally wanted to remain in the EU now saying they want Brexit delivered, according to the report.

With Post wires