But the prime minister immediately told the House of Commons that he will not negotiate an extension of Brexit negotiations beyond his 31 October deadline, despite a law requiring him to do so.
His defiant message sparked warnings that he will face court action on Monday.
In dramatic scenes in the House of Commons, an amendment delaying a meaningful vote on the prime minister’s EU withdrawal deal was passed by a margin of 322 votes to 306, to deafening cheers from thousands of second referendum supporters at the Together for the Final Say rally outside in Parliament Square.
The vote means Mr Johnson cannot secure parliamentary approval his deal by the end of 19 October and is required by the terms of the so-called Benn Act to write to Brussels to ask for an extension to the end of January 2020.
But he told MPs: "Alas, the opportunity to have a meaningful vote has effectively been passed up because the meaningful vote has been voided of meaning. I wish the house to know I'm not daunted or dismayed by this particular result.
"I continue in the very strong belief that the best thing for the UK and the whole of Europe is for us to leave with this new deal on 31 October. And, to anticipate the questions that are coming from the benches opposite, I will not negotiate a delay with the EU and neither does the law compel me to do so."
Mr Johnson said further delay would be "bad for this country, bad for the EU and bad for democracy".
Leader of the Commons Jacob Rees-Mogg told MPs that the government will now retable the motion for a “meaningful vote” under the terms of the EU Withdrawal Act on Monday.
But there was doubt over whether speaker John Bercow would allow another motion to be put forward so soon, as he told MPs it would be "most curious and irregular" if its purpose was to seek to invalidate today's vote.
Promising to rule on Monday whether the motion can be tabled, Bercow said: "I very, very, very politely reiterate that the government is not the arbiter of what is orderly. That cannot be so and it is not so and it will not be so, and there can be no argument about that."
The amendment tabled by former Conservative cabinet minister Sir Oliver Letwin was passed with the help of all DUP MPs, as well as the vast majority of Labour MPs and all other opposition parties. Some six Labour MPs and 17 independents backed the prime minister.
The European Commission said in a statement that it “takes note of the vote in the House of Commons today on the so-called Letwin Amendment meaning that the Withdrawal Agreement itself was not put to vote today".
The statement, issued by spokeswoman Mina Andreeva, added: "It will be for the UK government to inform us about the next steps as soon as possible."
Downing Street declined to say how Mr Johnson intended to avoid negotiating an extension to Brexit, with a spokesman saying only: “Governments comply with the law.”
The six Labour MPs supporting the PM were Kevin Barron, Ronnie Campbell, Jim Fitzpatrick, Caroline Flint, Kate Hoey and John Mann. Also opposing the Letwin motion were Tory exiles Richard Benyon, Steve Brine, Alistair Burt, Greg Clark, Stephen Hammond, Richard Harrington, Margot James, Caroline Nokes, Nicholas Soames, Rory Stewart and Ed Vaizey as well as former Labour independents Ian Austin, Frank Field, Kelvin Hopkins, Ivan Lewis and John Woodcock and suspended Tory Charlie Elphicke.
Labour leader Jeremy Corbyn warned Mr Johnson that he could not ignore the provisions of the Benn Act.
"It's an emphatic decision by this House that has declined to back the Prime Minister's deal today and clearly voted to stop a no-deal crash-out from the European Union," said Mr Corbyn.
"The Prime Minister must now comply with the law. He can no longer use the threat of a no-deal crash-out to blackmail members to support his sell-out deal."
The SNP leader at Westminster Ian Blackford said that if Mr Johnson acted as if we was "above the law", he would find himself in court.
Liberal Democrat leader Jo Swinson said: "The most urgent thing right now is the Prime Minister complies with the law."
SNP MP Joanna Cherry, who led a successful legal action against Mr Johnson's five-week suspension of parliament, told MPs: "Fortunately we are back in court on Monday morning. It will be possible then to secure the court's assistance if the prime minister has flouted the law and the promises he gave to the court."
Mr Bercow indicated that he is ready to sign the letter to Brussels requesting an extension if parliament or the courts instruct him to.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies