Boris Johnson will break his “do or die” pledge by seeking a delay to Brexit if he fails to secure a new agreement with Brussels by 19 October, a Scottish court has heard.

Government documents submitted to the Court of Session said the prime minister will send a letter asking for an extension to Article 50 – despite Mr Johnson’s repeated insistence that he will never delay Brexit.

The revelation emerged as part of a new legal challenge in Scotland’s highest court, where anti-Brexit petitioners are seeking an order to force the prime minister to comply with the so-called Benn Act, which requires him to ask for a delay if he has not secured a deal with Brussels.

Mr Johnson has been bullish in his refusal to delay Brexit beyond 31 October – but close allies have suggested that he will eventually allow himself to be forced “kicking and screaming” to request an extension to the UK’s Brexit talks.

Boris Johnson and Brexit merchandise for sale at the Tory conference Show all 10 1 /10 Boris Johnson and Brexit merchandise for sale at the Tory conference Boris Johnson and Brexit merchandise for sale at the Tory conference A Boris Johnson doll for sale at the Conservative Party Conference in Manchester on 29 September PA Boris Johnson and Brexit merchandise for sale at the Tory conference Mugs with Boris Johnson's portrait for sale at the Conservative Party Conference in Manchester on 29 September AP Boris Johnson and Brexit merchandise for sale at the Tory conference A Boris Johnson themed T-shirt for sale at the Conservative Party Conference in Manchester on 29 September AFP/Getty Boris Johnson and Brexit merchandise for sale at the Tory conference Boris Johnson and other Conservative themed cards for sale at the Conservative Party Conference in Manchester on 29 September AP Boris Johnson and Brexit merchandise for sale at the Tory conference Boris Johnson posters for sale at the Conservative Party Conference in Manchester on 29 September EPA Boris Johnson and Brexit merchandise for sale at the Tory conference Copies of The Conservative newspaper are ready to be distributed during the Conservative Party conference on 30 September Getty Boris Johnson and Brexit merchandise for sale at the Tory conference "GET BREXIT DONE" mugs alongside other Conservative merchandise at the party conference in Manchester on 29 September PA Boris Johnson and Brexit merchandise for sale at the Tory conference Assorted Conservative merchandise for sale at the party conference in Manchester on 29 September PA Boris Johnson and Brexit merchandise for sale at the Tory conference Books about Jacob Rees-Mogg and Jeremy Corbyn for sale at the Conservative Party conference in Manchester on 29 September Getty Boris Johnson and Brexit merchandise for sale at the Tory conference A variety of books for sale at the Conservative Party conference in Manchester on 29 September Getty

One Johnson ally told The Independent: “We think people will recognise this was not Boris’s doing. They will know who the Brexit blockers are, and give him the benefit of the doubt. They will trust him to get Brexit done.”

The legal action is being brought by SNP MP Joanna Cherry and barrister Jolyon Maugham – the same team behind the Supreme Court case that found Mr Johnson’s prorogation order was unlawful – along with millionaire environmentalist businessman Dale Vince.

Aidan O’Neill QC, representing the campaigners, told the court that submissions from the government revealed the prime minister “will send a letter ... no later than 19 October” to the EU.

He said the commitment went against promises made by Mr Johnson that he would rather be “dead in a ditch” than seek an extension, and that the UK will leave on 31 October “do or die”.

Mr O’Neill said: “We can’t trust this government, in light of statements it has made, that it will comply with the law.”

But Andrew Webster QC, representing the government, said there was no need for an order to be made forcing a letter to be sent as the court has it on record it will be done.

Independent Minds Events: get involved in the news agenda

He said: “What we have is a clear statement on behalf of the prime minister and government as to what it will do in respect to the requirements of the 2019 act.

“They have been put on record so there can be no doubt.”

He argued a court order would tie the PM’s hands while negotiating, but that Mr Johnson would abide by the Benn Act anyway and not attempt to “frustrate” its intention.

Lord Pentland, the judge, is to announce his decision on Monday.

Mr Maugham told Sky News: “What we learned today is that the prime minister has promised the court, in his own name, that he will ask for an extension under the Benn Act if the conditions are satisfied, in other words if parliament has not before 19 October agreed a withdrawal agreement.

“He’s also promised the court that he will not frustrate the Benn Act by which is meant that he will not send two letters, one saying ‘can I have an extension’, the other saying ‘please don’t give me one’, he won’t collude with foreign governments to attempt to persuade those foreign governments to veto an extension.”

He added: “There is no way to square that circle. And he is going to have to come clean either to parliament or the court.”

The legal bombshell comes after the prime minister used his Tory conference speech on Wednesday to promise to “get Brexit done” by exit day, come what may.

He told delegates: “That is why we are coming out of the EU on 31 October, come what may, conference.

“Let’s get Brexit done. We can, we must and we will, even though things have not been made easier by the surrender bill.

“We will work for a deal with our EU friends; but whatever happens we must come out by the end of October. Let’s get this thing done.”

No 10 refused to comment on the legal proceedings.

But allies have privately said that they expect him to push the confrontation right to the wire before finally signing the letter once it is clear that he is doing so absolutely against his will.

They believe this will put him in a powerful position to frame the coming general election as a battle between the people and the establishment, having shown that he did all that was humanly possible to deliver a 31 October Brexit, but was thwarted by parliament and the courts.

Downing Street insiders take comfort from focus groups suggesting that Leave voters would not blame Mr Johnson if they realised he had fought an extension “tooth and nail”.

In a sign of the challenge Mr Johnson faces, staunch Brexiteer Steve Baker said: “A source confirms all this means is that government will obey the law. It does not mean we will extend.

“It does not mean we will stay in the EU beyond Oct 31. We will leave.”

But Brexit Party leader Nigel Farage said: “Boris said we would leave by 31 October ‘do or die’.