A cross-party alliance defeated Prime Minister Boris Johnson in parliament on Tuesday night in a bid to prevent a no-deal Brexit - a move that the government warned would thrust Britain towards an October snap election.
Lawmakers voted by 328 to 301 for a motion put forward by opposition parties and rebel Tory MPs - who had been warned they would be kicked out of the Conservative Party if they defied the government.
Twenty one Tory MPs rebelled against the Government and voted with the opposition parties. Two Labour rebels voted with the Government – Kate Hoey and John Mann.
All 13 Scottish Conservative MPs backed Johnson. Scotland First Minister Nicola Sturgeon tweeted: "Scotland voted 62% to remain in the EU and yet not a single Scottish Tory MP voted to prevent a 'no deal' Brexit tonight."
The defeat leaves the course of Brexit unresolved, with possible outcomes still ranging from a turbulent 'no-deal' exit to another referendum although a fresh election also now looks inevitable.
Shortly after the result of the vote was announced, Brexit Party leader Nigel Farage tweeted: "I fear that we are rapidly headed towards a very dark place."
Tuesday night's victory is the first hurdle for MPs who, having succeeded in taking control of parliamentary business, will on Wednesday seek to pass a law forcing Johnson to ask the EU to delay Brexit until January 31 unless he has a deal approved by parliament beforehand on the terms and manner of the exit.

The Conservative rebels who now face expulsion from the party included Nicholas Soames, the grandson of Britain's World War Two leader Winston Churchill, and two former chancellors - Philip Hammond and Kenneth Clarke.
Labour MP Mary Creagh questioned whether Johnson would follow through on his threat to remove the whip from rebel Tory MPs.
She tweeted: "I simply do not think Johnson will deselect courageous @NSoames (Nicholas Soames), Churchill's grandson, from the Tory Party. Tonight's vote shows that his bluff and bluster has fooled no-one".
But the BBC's Political Editor Laura Kuenssberg, citing Government sources, said all 21 MPs will be kicked out of the party as Johnson seeks a purge of those seen as soft on Brexit.
A Downing Street spokesman said: ''The Chief Whip is speaking with those Tory MPs who did not vote with the Government this evening. They will have the whip removed.''
Earlier in the day to the Lib Dems as the PM spoke at the despatch box, wiping out the Government’s slender majority of one.
In an historic showdown between prime minister and parliament, Johnson's opponents said they wanted to prevent him playing Russian roulette with a country once touted as a confident pillar of Western economic and political stability.
They argue that nothing can justify the risk of a 'no-deal' Brexit that would cut economic ties overnight with Britain's biggest export market and inevitably bring huge economic disruption.
Johnson cast the challenge as an attempt to force Britain to surrender to the EU just as he hopes to secure concessions on the terms of the deal, helped by the threat to walk out without one.

After the vote Johnson said Parliament is on the brink of wrecking the chances of any Btrexit deal. He also said he will be tabling a vote for an early general election on Wednesday under the Fixed Term Parliament Act.
He said: ''The consequences of this vote tonight means that Parliament is on the brink of wrecking any deal that we might be able to get in Brussels. It will hand control of the negotiations to the EU.''

Johnson continued: "And by contrast, everyone will know that if I am Prime Minister, I will go to Brussels, I will go for a deal and I believe I will get a deal.
"And we will leave anyway, even if we don't (get a deal) we will leave anyway on October 31.
"The people of this country will have to choose.
"The leader of the opposition has been begging for an election for two years.
"He has thousands of supporters outside calling for an election. I don't want an election but if MPs vote tomorrow to stop negotiations and to compel another pointless delay to Brexit potentially for years then that would be the only way to resolve this.
"I can confirm that we are tonight tabling a motion under the Fixed Term Parliament Act."
Labour leader Jeremy Corbyn said it is fine for Johnson to table a motion for a general election, but that no-deal must be removed as an option first.
Corbyn said the Government must "get the Bill through first in order to take no-deal off the table".
He added: "We do not have a presidency, we have a Prime Minister who governs with the consensus of the House of Commons representing the people within whom the sovereignty rests."
The Labour leader said that there is no consent to leave the EU without a deal, saying: "There is no majority to leave without a deal within the country".
Corbyn called on Johnson to put his Brexit plan to the people, if he has one.