David Cameron has warned Boris Johnson that breaking the law is “not a good idea” ahead of a critical ruling from the Supreme Court on the suspension of parliament.

In just days, the UK’s highest court will determine whether the prime minister’s decision to prorogue parliament until 14 October was unlawful.

Depending on the legal basis upon which the judges reach their conclusions, the Commons may have to reconvene if Downing Street, which has refused to rule out a second suspension, loses the case.

Mr Cameron, the former Tory prime minister, said he had been in contact with Mr Johnson since he entered Downing Street, and told him breaking the law was the wrong path to take.

Speaking to Sky News’ Sophy Ridge on Sunday, Mr Cameron added he had not yet had a one-to-one meeting with Mr Johnson, but said the pair had exchanged texts.

Supreme Court protests: Boris Johnson's prorogation legal or not? Show all 15 1 /15 Supreme Court protests: Boris Johnson's prorogation legal or not? Supreme Court protests: Boris Johnson's prorogation legal or not? Protesters gather outside The Supreme Court ahead of a hearing on the legality of Boris Johnson's proroguing of Parliament Getty Supreme Court protests: Boris Johnson's prorogation legal or not? The supreme court justices will sit as a panel of 11 judges to hear the challenge, brought by campaigner Gina Miller, that the Prime Minister acted unlawfully when he advised the Queen to suspend parliament AP Supreme Court protests: Boris Johnson's prorogation legal or not? A woman protests outside the Supreme Court Reuters Supreme Court protests: Boris Johnson's prorogation legal or not? The PM sent lawmakers home on 9 September until 14 October, just over two weeks before the UK is due to leave the European Union AP Supreme Court protests: Boris Johnson's prorogation legal or not? Gina Miller arriving AP Supreme Court protests: Boris Johnson's prorogation legal or not? People protest outside the Supreme Court Reuters Supreme Court protests: Boris Johnson's prorogation legal or not? Boris Johnson likened himself to the Incredible Hulk days previous as he promised to ignore the Commons legislation ordering him to delay Brexit if negotiations break down PA Supreme Court protests: Boris Johnson's prorogation legal or not? Officials bring in documents Reuters Supreme Court protests: Boris Johnson's prorogation legal or not? Protesters hold banners outside the Supreme Court in London, Tuesday Sept. 17, 2019. The Supreme Court is set to decide whether Prime Minister Boris Johnson broke the law when he suspended Parliament on Sept. 9, sending lawmakers home until Oct. 14 â€” just over two weeks before the U.K. is due to leave the European Union. (AP Photo/Matt Dunham) Matt Dunham AP Supreme Court protests: Boris Johnson's prorogation legal or not? Protesters hold banners outside the Supreme Court in London, Tuesday Sept. 17, 2019. The Supreme Court is set to decide whether Prime Minister Boris Johnson broke the law when he suspended Parliament on Sept. 9, sending lawmakers home until Oct. 14 â€” just over two weeks before the U.K. is due to leave the European Union. (AP Photo/Matt Dunham) Matt Dunham AP Supreme Court protests: Boris Johnson's prorogation legal or not? Protesters hold banners outside the Supreme Court in London, Tuesday Sept. 17, 2019. The Supreme Court is set to decide whether Prime Minister Boris Johnson broke the law when he suspended Parliament on Sept. 9, sending lawmakers home until Oct. 14 â€” just over two weeks before the U.K. is due to leave the European Union. (AP Photo/Matt Dunham) Matt Dunham AP Supreme Court protests: Boris Johnson's prorogation legal or not? People protest outside the Supreme Court of the United Kingdom during a hearing on Prime Minister Boris Johnson's decision to prorogue parliament, in London, Britain September 17, 2019. REUTERS/Phil Noble PHIL NOBLE Reuters Supreme Court protests: Boris Johnson's prorogation legal or not? Protesters hold banners outside the Supreme Court in London, Tuesday Sept. 17, 2019. The Supreme Court is set to decide whether Prime Minister Boris Johnson broke the law when he suspended Parliament on Sept. 9, sending lawmakers home until Oct. 14 â€” just over two weeks before the U.K. is due to leave the European Union. (AP Photo/Matt Dunham) Matt Dunham AP Supreme Court protests: Boris Johnson's prorogation legal or not? Joanna Cherry of the Scottish National Party leaves the Supreme Court Reuters Supreme Court protests: Boris Johnson's prorogation legal or not? Demonstrators protest outside the Supreme court in central London on the first day of the hearing into the decision by the government to prorogue parliament on September 17, 2019. (Photo by Tolga Akmen / AFP)TOLGA AKMEN/AFP/Getty Images TOLGA AKMEN AFP/Getty

“He’s very busy. He knows my views on most things,” the former Conservative leader said. “No deal is not a good idea. Breaking the law is not a good idea. Focus everything you’ve got on getting that deal, and that’s what he’s doing, to be fair to him.

“The most important thing he is trying to do, he has my support for, which is going to Brussels, getting a deal, bringing that deal and trying to end this period of uncertainty and I wish him well as he does that.”

On the case, Labour’s shadow Brexit secretary and former director of public prosecutions Sir Keir Starmer, said: “I’m not sure why the judgement needs as much time as it’s being given – it’s fairly short, easy judgement, isn’t it?

Proceedings on the third day of the hearing on prorogation (EPA)

“He’s lied to every other woman he’s ever met – why would he make an exception for the Queen? Proroguing overturned.”

A panel of 11 justices heard appeals over three days arising out of separate legal challenges in England and Scotland, in which leading judges reached different conclusions.

At the close of the unprecedented hearing on Thursday, the court’s president Lady Hale said the judges hope to give their decision early next week.

She said: “I must repeat that this case is not about when and on what terms the United Kingdom leaves the European Union.

“The result of this case will not determine that. We are solely concerned with the lawfulness of the Prime Minister’s decision to advise Her Majesty to prorogue Parliament on the dates in question.