LONDON — After vowing for weeks that Britain would leave the European Union on Oct. 31 with or without a deal easing the transition, the government said in documents released on Friday that Prime Minister Boris Johnson would ask for another delay if he failed to secure an agreement by mid-October.

Parliament passed a measure in September obligating the prime minister to send a letter to Brussels asking to delay Brexit until the end of January if no deal has been reached by Oct. 19, but Mr. Johnson has refused to state publicly that he would ask for an extension.

Mr. Johnson has also said that he would rather be “dead in a ditch” than delay Brexit, and the commitment — revealed in court proceedings — did not necessarily spell the end of his back-room maneuvering to avoid extending the Brexit deadline. An extension would be the third such delay.

He stuck to his hard-line tone on Twitter on Friday, writing that the choices were “new deal or no deal - but no delay.”