European Union chief Brexit negotiator Michel Barnier speaks with the media as he walks out of EU headquarters in Brussels.

Boris Johnson gives a statement to the House of Commons on his Brexit proposals.

Embattled British Prime Minister Boris Johnson will ask the EU for a Brexit delay if no deal is reached by Oct. 19.

It’s a step the prime minister is required to take under a new law recently passed by opposition politicians, the BBC reported, citing a government filing to a Scottish court.

Johnson had intended to leave the bloc, deal or no deal, a prospect that’s roiled financial markets because of the massive disruption it would cause.

The EU has said it’s open to considering a request for an extension beyond an Oct. 31 deadline if the UK asks for one.

But the Johnson government continued to muddy the issue, with reps acknowledging only that they would legally comply with the “very specific narrow duty” of the law — but implying that it still gave them wiggle room.

Johnson has said previously he would rather be “dead in a ditch” than ask European leaders for another extension.

Also, a Scottish judge is being asked to consider whether Johnson could be jailed if he takes the UK out of the EU without a deal, the BBC reported.