MPs have voted to take control of Commons business in an unprecedented move to try to find a majority for any Brexit option.
The government was defeated by 329 votes to 302 on the cross-party amendment, a majority of 27.
It means MPs will get a series of votes on Wednesday to find out what kind of Brexit they will support.
Prime Minister Theresa May has said there is no guarantee she will abide by their decision.
- LIVE: MPs take control of Brexit process
But Labour Leader Jeremy Corbyn, who had backed the amendment tabled by Conservative Sir Oliver Letwin, said the government “must take the process seriously”.
He added: “The government has failed and this House must, and I believe will, succeed.”
He said MPs would want to find a consensus on the way forward, including a possible “confirmatory vote” on the PM’s deal by the public – something Mrs May told MPs earlier she did not want because Remain would be on the ballot paper.
Mrs May had earlier tried to head off a defeat by offering MPs a series of votes on Brexit alternatives, organised by the government.
She said allowing MPs to take over the Commons agenda would have set an “unwelcome precedent”.
But supporters of Sir Oliver Letwin’s amendment said they did not trust the government to give MPs a say on the full range of Brexit options.
Thirty Tory MPs voted against the government, including three ministers – Richard Harrington, Alistair Burt and Steve Brine – who have now resigned from their ministerial posts.
Following the vote, Shadow Brexit Secretary Sir Keir Starmer tweeted: “Another humiliating defeat for a prime minister who has lost complete control of her party, her Cabinet and of the Brexit process.
“Parliament has fought back – and now has the chance to decide what happens next.”
MPs involved in the bid tonight say if there is a majority for a plan that’s not the prime minister’s deal then there would be “uproar” if Theresa May tried to ignore it.
It is possible, of course, that Brexiteers who have been resisting the prime minister’s deal so far take fright at Parliament having more control of the process, and are more likely to come in line.
That’s because, generally, the make-up of MPs are more likely to back a softer deal than the one on offer.
So faced with the choice of Theresa May’s compromise this week, or a much longer wrangle to a closer relationship with the EU than the prime minister has negotiated, it is not impossible that the numbers will move in her favour.
Read Laura’s blog
In the series of so-called indicative votes, MPs will be able to vote on a series of options – likely to include a “softer Brexit”, a customs union with the EU and another referendum – designed to test the will of Parliament to see what, if anything, commands a majority.
But the precise format of the votes and how they will work was not set out in the amendment.
And the prime minister said she was “sceptical” about the process – as it was not guaranteed to produce a majority for any one course of action – and she would not commit the government to abiding by the result.
“The votes could lead to an outcome that is un-negotiable with the EU,” she told MPs.
The Department for Exiting the EU said Monday night’s vote set a “dangerous, unpredictable precedent” for the future.
“It is disappointing to see this amendment pass, as the government made a clear commitment to provide a process to find a majority in Parliament for a way forward this week,” a spokesman said.
“While it is now up to Parliament to set out next steps in respect of this amendment, the government will continue to call for realism – any options considered must be deliverable in negotiations with the EU.
“Parliament should take account of how long these negotiations would take and if they’d require a longer extension which would mean holding European Parliamentary elections.”
The government narrowly defeated a bid by Labour’s Dame Margaret Beckett to give MPs a vote on asking for another Brexit extension if a deal has not been approved by 5 April. Dame Margaret’s amendment was voted down by 314 to 311, a majority of three.
The government was defeated on its main motion, as amended by Sir Oliver Letwin, by 327 votes to 300, a majority of 27.
Mrs May said earlier that her EU withdrawal deal did not have enough support to get through the Commons “as things stand”, but she still hoped to persuade enough MPs to back it so she could hold another vote on it this week.
The deal has already been rejected twice by a large margin – and the PM was forced to ask the EU for Brexit to be delayed.
She plans to pass a law this week cancelling 29 March’s exit date, and pushing Brexit back to at least 12 April.