UK PM Boris Johnson suffered a major parliamentary defeat over his Brexit strategy on Tuesday.

A British judge on Wednesday ruled in favour of Boris Johnson's decision to suspend parliament in a move that will provide some respite for the beleaguered prime minister.

Judge Raymond Doherty at the Court of Session in Edinburgh, Scotland's highest court, rejected a legal challenge by Johnson's opponents -- one of three before the courts.

"This is political territory and decision-making, which cannot be measured by legal standards, but only by political judgements," Doherty said in his ruling.

"I do not accept the submission that the prorogation contravenes the rule of law," the judge said.

Joanna Cherry, an MP for the Scottish National Party (SNP), who was one of the people behind the challenge, said the judge had ruled that the court could not pronounce itself on the exercise of government's power to suspend parliament.

"Seems we have lost," she tweeted.

Lawyer Jolyon Maugham, who also supported the challenge, said: "The idea that if the PM suspends parliament the court can't get involved looses some ugly demons.

"If he can do it for 34 days why not 34 weeks or 34 months? Where does this political power end?" he wrote.

Johnson's decision last week to drastically reduce the number of days parliament can sit before the current date of Brexit on October 31 caused widespread outrage.

The decision was seen as a move to curb opposition attempts to block his Brexit strategy and bring down his government.

A separate legal challenge supported by former prime minister John Major is due to be heard in court in London on Thursday.