MPs have voted not to give their approval to the prime minister's Brexit deal until he has passed all necessary legislation.
The result will effectively force Boris Johnson to seek an extension to the Article 50 negotiating period tonight, possibly delaying Brexit beyond 31 October.
The House of Commons voted 322 to 306 in favour of an amendment, proposed by former Conservative minister Sir Oliver Letwin, to a motion on the prime minister's Brexit deal.
The vote went against Mr Johnson, who has promised to deliver Brexit on 31 October "do or die", after the DUP gave their backing to Sir Oliver's amendment.
The Northern Ireland party are fiercely opposed to the prime minister's Brexit deal.
Advertisement
WHAT HAPPENS NOW?
- The PM is compelled to write to the EU requesting an Article 50 extension beyond 31 October
- He will attempt to put his Brexit deal to another vote in the House of Commons on Monday
- The government will also next week introduce necessary Brexit legislation
- If the legislation passes before 31 October, the UK is still able to leave the EU on that date
- Watch Brexit Special on Sky News at 7pm tonight from Westminster
Eight of the 21 former Conservative MPs the prime minister withdrew the Tory whip from last month – including ex-cabinet ministers Philip Hammond, David Gauke and Justine Greening – also backed Sir Oliver's amendment.
They were among a total of 10 former Tory MPs, who now sit as independent MPs, to support the amendment.
Six Labour MPs defied their party's orders and voted against the amendment.
There were cheers from among the hundreds of thousands of people at a People's Vote rally in Westminster, who want a second EU referendum, as the vote result was announced.
Under legislation passed last month, known as the Benn Act, Mr Johnson is compelled to write to the EU tonight seeking an extension.
This is because he has failed to gain approval for a Brexit deal – and MPs have not explicitly endorsed a no-deal Brexit.
The European Commission urged the government to inform them of "next steps as soon as possible".
French President Emmanuel Macron's office revealed he had spoken to Mr Johnson and "shared his view for the need for a swift clarification".
"He signalled a delay would be in no one's interest," the official added.
But Irish foreign minister Simon Coveney reiterated Dublin's stance that a Brexit delay is "preferable" to a no-deal Brexit, although he also stressed all other EU member states would need to unanimously back an extension for it to be granted.
Speaking after his defeat, Mr Johnson told MPs the so-called meaningful vote on his Brexit deal had "effectively been passed up because the meaningful vote has been voided of meaning".
But the prime minister said he was not "daunted or dismayed" by what he described as a "pretty close" result, and reiterated his pledge to take the UK out of the EU on 31 October.
"I will not negotiate a delay with the EU and neither does the law compel me to do so," he said.
"I will tell our friends and colleagues in the EU exactly what I have told everyone in the last 88 days I have served as prime minister; that further delay will be bad for this country, bad for the EU and bad for democracy."
Mr Johnson expressed his hope the EU "will not be attracted" to granting an Article 50 extension.
Leader of the House of Commons, Jacob Rees-Mogg, revealed the government will attempt to stage another meaningful vote on the Brexit agreement on Monday.
Mr Rees-Mogg was heckled with shouts of "scum", "shame on you" and "fascist" as he left parliament with his young son and a police escort after the vote.
Next week, the government will also introduce the Withdrawal Agreement Bill needed to put Mr Johnson's Brexit deal into law.
The prime minister told MPs he was hopeful they will "change their minds" and subsequently vote in favour of his deal and the legislation.
Labour leader Jeremy Corbyn told Mr Johnson he "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," Mr Corbyn said.
"Labour is not prepared to sell out the communities that we represent. We're not prepared to sell out their future.
"And we believe that, ultimately, the people must have the final say on Brexit which actually only the Labour Party is offering."
Sir Oliver said his amendment was an "insurance policy" to prevent Britain "crashing out" of the EU without a deal on 31 October.
He told MPs he backs the prime minister's deal but wants to "ensure that whichever way any future votes may go… we can be secure in the knowledge that the UK will have requested an extension tonight, which if granted can be used if and to the extent necessary, and only the extent necessary, to prevent a no-deal exit."
Opening the Commons debate earlier, the prime minister urged MPs to ditch the "delusion" that they could delay Brexit again and said: "It is now my judgement that we have reached the best possible solution.
"Now is the time to get this thing done, and I say to all members let us come together as democrats to end this debilitating feud."
But Mr Corbyn has said his MPs would "not be duped" into supporting the PM's Brexit deal and dismissed Mr Johnson's "empty promises" on workers' rights and the environment.