LONDON — Just as it seemed Brexit couldn’t become any more surreal, a former Conservative prime minister argued against the current Conservative prime minister Thursday on the third and final day of a landmark Supreme Court hearing.

John Major submitted in written testimony that the contention that there are no legal constraints on a prime minister’s ability to suspend Parliament “would be a remarkable position for the courts to endorse.”

Major further accused Boris Johnson of being motivated by “political interest” when he decided to shut down Parliament for five weeks ahead of the deadline for Britain to leave the European Union.

Major has been a vocal opponent of Brexit and has advocated for a second referendum. So his opposition to Johnson, who headlined 2016 Brexit campaign, is not surprising. But it is unusual for British prime ministers from the same party to challenge each other so directly.

The case is testing the outer limits of Britain’s unwritten constitution and the balance of power among the executive, legislature and judiciary.

“None of this is easy,” Brenda Hale, the president of the Supreme Court, told the courtroom. She promised a ruling “early next week.”

The high court was called in for an emergency session to weigh contrasting judgments over Johnson’s decision to suspend Parliament until mid-October. Britain is scheduled to leave the European Union on Oct. 31, though a withdrawal deal remains elusive.

A Scottish court ruled that Johnson’s suspension was an “egregious” overreach that aimed to thwart the legislature’s ability to scrutinize the government’s Brexit plans. An English court dismissed a related case, saying that it was a political matter and not one for the courts to decide.

If the Supreme Court finds Johnson acted unlawfully — and essentially mislead the queen when he requested her approval — it is possible lawmakers could return almost immediately to work.

On Thursday, however, speaking in Wiltshire, England, Johnson would not rule out suspending Parliament again if he lost the case.

The three-day hearing — streamed live — has been by turns unprecedented, impenetrable, important and a bit testy.

On Wednesday, Aidan O’Neill, a lawyer representing 70-plus lawmakers who launched a case against Johnson’s shutdown, told the judges not to let “the mother of Parliaments be shut down by the father of lies.”

O’Neill called Johnson’s government “unworthy of our trust.”

On Thursday, Richard Keen, a lawyer for the government, called the charges against Johnson “discourteous, incendiary and wholly unwarranted.”

Keen warned the judges against wading into an “ill-defined minefield.”

Johnson did not provide the court an explanation for his decision — which Major said was “conspicuous.”

Johnson has said publicly that the suspension was necessary to prepare a new legislative agenda. It’s normal for a government to do that, but the length of the break is usually measured in days, not weeks.

Major suggested the court would be “artificially naive” to believe what’s in the public record.

Johnson was less directly challenged this week by former Conservative prime minister David Cameron. In his new memoir, Cameron said Johnson acted “appallingly” and misled voters on Brexit.