LONDON (Reuters) - A Scottish court on Monday rejected a legal bid to force Boris Johnson to ask for a Brexit delay if he has not struck a deal with the European Union in less than two weeks’ time, saying the British Prime Minister had given assurances he would do so.

Last month British lawmakers passed legislation, known as the “Benn Act”, which requires Johnson to send a letter to the EU asking for a delay if no divorce agreement has been struck by Oct. 19, to stop what opponents say would be calamitous no-deal Brexit.

With the clock ticking down to Britain’s due departure on Oct. 31, however, Johnson has consistently said he would not ask for a delay and that he would rather be “dead in a ditch” than seek any further extension.

But he has also said he would not break the law, which he has dubbed “the surrender act”, without explaining that apparent contradiction.

Anti-Brexit campaigners, who believe Johnson will use a legal loophole or send a second letter, threatening to sabotage EU processes if they grant a Brexit delay, asked Scotland’s Outer House of the Court of Session to issue an order compelling him to comply with the Benn Act.

“The government accepts that in executing its political policy it must comply with the 2019 Act,” the judge, Paul Cullen, said in his ruling rejecting their challenge.

“There can be no doubt that (Johnson) now accepts that he must comply with the requirements of the 2019 Act and has affirmed that he intends to do so.”

On Friday, the court heard that the Advocate General, the government’s top legal officer in Scotland, had given assurances that Johnson would fully comply with the Benn Act, the first time the government had publicly acknowledged that Johnson would be required to ask for a Brexit delay.

Cullen said the Advocate General had stated “clearly and unequivocally the prime minister’s intention to comply with his statutory duties” with “detailed and specific” legal declarations.

“The content of the duty imposed on the prime minister and the circumstances in which he becomes liable to fulfill that duty are carefully and precisely spelled out,” said the judge, who added that “extra-judicial” remarks could not be taken as “conclusive statements of the government’s understanding of its legal obligations”.

Lawyer Jo Maugham, one of the campaigners who sought the order, said they expected Scotland’s highest court to hear their appeal on Tuesday.

Johnson’s office had no comment, but before the verdict was given he said: “We will study any judgments very closely as we always do. We will respect the law and we will leave the European Union on Oct. 31.”