LONDON     -  British Prime Minister Boris Johnson will send a letter to the European Union asking for a Brexit delay if no divorce deal has been reached by Oct. 19, according to government papers submitted to a Scottish court.

Johnson submitted new proposals to the EU on Wednesday which he hopes will lead to a deal for Britain to leave on Oct. 31, the deadline set by Brussels. British parliament refused to back an agreement his predecessor reached with EU leaders.

But, just over a week after a British Supreme Court ruling that 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 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 Johnson said he could not comment on ongoing legal proceedings.

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 Oct. 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 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 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 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 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 Maugham.

Johnson’s new proposal is intended to offer arrangements for the border between EU member Ireland and the British province of Northern Ireland. Despite the Benn Act, Ireland’s Foreign Minister Simon Coveney said the EU remained concerned about the possibility of a no-deal Brexit on Oct. 31.

Dublin has said it cannot sign up to a treaty that does not safeguard an open Irish-British border.

“I think British politics is so unpredictable right now, that we can’t rely even on the law in Britain in this context,” he told RTE on Friday.

The legal challenge is the latest case which has seen judges called in to arbitrate over Brexit, with all high-profile cases so far going against the government.

In 2017, the Supreme Court ruled that ministers could not give the EU the official divorce notice without parliament’s approval. Last month, the top court ruled Johnson’s five-week suspension of parliament unlawful, forcing the legislature to be reconvened.

Both cases provoked criticism from Brexit supporters who accused judges of overstepping their powers by getting involved in political matters. While Johnson said he respected the recent decision, he also said the court was wrong. Maugham and Cherry were also involved in a successful case against the government last December when the European Court of Justice ruled that Britain could unilaterally revoke the official “Article 50” notice to leave the EU.