Judges at Scotland's highest civil court are waiting to see if Boris Johnson fully complies with the Benn Act in seeking a Brexit extension before making a decision on whether he has broken the law.
At the hearing before the Court of Session in Edinburgh on Monday, it was accepted the Prime Minister had observed part of the legislation by sending the request by letter to the EU.
Mr Johnson was legally obliged to ask for an extension in Brexit talks on Saturday, but did not sign the letter making this request from the EU.
He also sent a second letter - which he did put his name to - that said a delay would be a mistake.
Critics argued this meant the prime minister could have been in contempt of court.
Petitioners including businessman Dale Vince, Jolyon Maugham QC and SNP MP Joanna Cherry QC have now been granted a request by three of Scotland's most senior judges to postpone any decision to see if the terms of the Act have been fully carried out.
This includes waiting to see if any potential extension granted by the EU is accepted by the Prime Minister.
What was said in court?
Aidan O'Neill QC, representing the petitioners, described the manner in which the letter was sent as "unusual".
He added: "We don't know when the EU will come back with a response for the request.
"So it depends on it coming back and ensuring the Prime Minister carried out the duties imposed upon him within the Benn Act."
Mr O'Neill claimed there was a breach of the principle that Mr Johnson would not try to frustrate the purposes of the legislation, but this would also be for the court to decide at a later date.
Judge Lord Brodie said: "I think it is fair to say it was a very carefully written letter."
Mr O'Neill said the Prime Minister was "sailing very close to the wind" and "not entirely in accord with spirit" of the Act by sending the second letter, in which he said an extension would "damage" the UK's interests.
The case could also be made null if Parliament accepts the withdrawal deal brought to them by the Prime Minister.
David Johnston QC, representing the UK Government, argued the appeal should be dismissed as the letter had been sent.
The court said it would return to the matter at a later date.
Why did this end up in court?
Mr Johnson abandoned plans for a meaningful vote on a Saturday sitting of the Commons after suffering an embarrassing defeat at the hands of former Tory minister Sir Oliver Letwin.
After losing the vote, Mr Johnson had no option but to write to European Council President Donald Tusk, as Parliament demanded, requesting a three-month extension to the end of January.
The PM did not sign the letter, and sent a second communication insisting that a delay would be “deeply corrosive” for the UK and the EU.
Mr Johnson had been legally required to send the letter as he had not gained the backing of MPs for his plan, but in it he stressed to Brussels he was only sending the document at Parliament’s bidding.
Shadow chancellor John McDonnell accused Mr Johnson of “behaving a bit like a spoilt brat” in the way he communicated with Brussels over the extension request.
If the prime minister’s deal is amended he will have no choice but to accept a long delay to the UK’s departure from the bloc.
A Government source said: “Parliament needs a straight up-and-down vote on the deal… or do they want to frustrate and cancel Brexit altogether?
“We cannot allow Parliament’s letter to lead to Parliament’s delay.”
The source said the Withdrawal Agreement Bill (WAB) would need more late-night and weekend sittings by MPs.
Asked on Sunday if the EU was going to be open to an extension, its chief negotiator, Michel Barnier, said Mr Tusk would consider the next stage.