British Prime Minister Boris Johnson will request a Brexit delay from the European Union if no divorce deal has been agreed between Brussels and the UK by October 19, according to government papers submitted to a Scottish court.
Talks to reach a deal are continuing and Mr Johnson submitted new proposals to the EU this week.
Mr Johnson has said if the proposals are rejected then the UK will still leave the EU by the deadline of October 31.
But, just over a week after a British Supreme Court ruling that Mr Johnson had suspended the parliament unlawfully and weeks before the deadline, anti-Brexit campaigners turned to judges to try to ensure Britain does not leave without a deal.
They want the judges to rule that Mr Johnson must abide by a law passed by parliament last month requiring him to delay Brexit if he has not agreed a withdrawal treaty in the next two weeks.
They say a no-deal Brexit would have calamitous economic repercussions for Britain after it leaves the political and trading group it joined in 1973.
A spokesman for Mr Johnson said he could not comment on ongoing legal proceedings.
Mr Johnson has said he will abide by the new law, known as the "Benn Act". But he has also said he will not ask for any delay and that Britain will leave the EU anyway on October 31. He has not explained the apparent contradiction in his comments.
Opponents say they believe he will seek some kind of legal escape route or try to pressure the EU into refusing to agree to an extension request.
The anti-Brexit campaigners filed two linked challenges to Mr Johnson in Scotland's Outer House of the Court of Session in Edinburgh and the court's Inner House, the highest Scottish court.
The cases not only seek a legal order forcing Mr Johnson to abide by the Benn Act. If he does not, they want the court to use its powers, not available in English courts, to write to EU leaders itself requesting an extension on his behalf.
The legal challenge, fronted by tax lawyer Jo Maugham and Joanna Cherry, a lawmaker from the Scottish National Party, also says that if Mr Johnson fails to comply with the Benn Act the courts could impose penalties "including fine and imprisonment".
In submissions to the Scottish court, the government said Mr Johnson accepted he was obliged to send a letter to the EU asking for a delay and that if an extension was granted, Britain would also agree to it.
"In the event that neither of the conditions set out ... is satisfied he will send a letter in the form set out in the schedule by no later than 19 October 2019," said the document posted on Twitter by Mr Maugham.