A BID to persuade a Scottish court to issue an order forcing Boris Johnson to obey the law and ask the EU for a Brexit extension has been dismissed.

Campaigners had wanted to ensure the Prime Minister complies with the so-called Benn Act, which states he must send a letter requesting an Article 50 extension if no deal has been agreed by October 19.

But the Court of Session said it would be "neither necessary nor appropriate" to take action, as Mr Johnson had assured it he will comply with the legislation.

The Prime Minister has insisted he would rather be “dead in a ditch” than delay the UK’s exit beyond October 31.

Meanwhile, Downing Street sources have repeatedly suggested Mr Johnson will find a way around the Benn Act.

But documents submitted to the Court of Session on behalf of the Prime Minister last week said he would not attempt to frustrate the legislation.

READ MORE: Tories told they should be panicking over independence 

A legal challenge brought by businessman Dale Vince, QC Jo Maugham and SNP MP Joanna Cherry sought "coercive orders" forcing Mr Johnson to send the letter, as they argued he could not be trusted. This would have opened up the possibility of criminal sanctions if he did not.

However, in a written ruling, Lord Pentland said there "can be no doubt that the first respondent now accepts that he must comply with the requirements of the 2019 [Benn] Act and has affirmed that he intends to do so".

He warned that if Mr Johnson failed to comply with the legislation, it could damage the "mutual trust" between the courts and government.

He said: "I approach matters on the basis that it would be destructive of one of the core principles of constitutional propriety and of the mutual trust that is the bedrock of the relationship between the court and the Crown for the Prime Minister or the government to renege on what they have assured the court that the Prime Minister intends."

READ MORE: EU leaders unmoved by 'outstretched hand' of Boris Johnson 

Lord Pentland said the documents submitted to the court by the Advocate General, on behalf of Mr Johnson, "set out clearly and unequivocally the Prime Minister’s intention to comply with his statutory duties under the 2019 Act".

He continued: "The Prime Minister and the government having thus formulated and presented to the court their considered legal position, there is no proper basis on which the court could hold that they are nonetheless liable to fail to do what they have in effect undertaken to the court that they will do."

He also said statements made by Mr Johnson and other ministers around the issue "must be understood in the political context in which they were made", as "expressions of the government’s political policy".

He later said: "If I may put the point another way, the government accepts that in executing its political policy it must comply with the 2019 Act.

"That being the government’s clearly stated position before the court, there is no need for coercive orders against it or against the Prime Minister to be pronounced."

The EU Withdrawal (No2) Act – known informally as the Benn Act after its architect, the Labour MP Hilary Benn – was passed by MPs last month.

Mr Vince, Mr Maugham and Ms Cherry are expected to appeal the latest decision at the Inner House of the Court of Session today.

Orders sought included stopping the Prime Minister from "frustrating" the will of the Act and mandating him to send the request. This would prevent him asking another member state to block the extension or sending an additional letter which contradicts the original.

Writing on Twitter, Mr Vince said: "It might not look like it, but we won today."

He added: "It was always my understanding that we couldn’t actually lose this case, because either the court would issue the injunction obliging BJ to uphold the law - or he would give clear undertakings to the court that he would do so."

Speaking outside the Court of Session, Mr Maugham said: "The court said it has promises from the Government that the Government will send the letter mandated by Parliament and will act in a way as not to frustrate Parliament's intention in enacting the so-called Benn Act. For myself, I very much hope the court is right and the Government will, as it has promised to do, abide by the law.

"But there is very real doubt in my mind that the Government will act in accordance with the law and so tomorrow we will pursue our appeal against the decision of the Outer House to the Inner House of the Court of Session."