Peers have voted to give Parliament a potentially decisive say over the outcome of Brexit talks.
An amendment to the EU Withdrawal Bill giving MPs the power to stop the UK from leaving without a deal or to make Theresa May return to negotiations was approved by 335 votes to 244.
Its supporters said Parliament, not ministers, must “determine the future of the country”.
The government will now try to persuade MPs to strike out the change.
- Remain-backing MPs seize on Davis comment
- Brexit: All you need to know
- A guide to the EU Withdrawal Bill
- UK will leave customs union, insists No 10
Ministers said giving Parliament such a power risked “weakening” the UK’s hand in negotiations.
But Labour said the vote marked a “hugely significant moment” in the fight to ensure Parliament has a “proper role” in the Brexit negotiations and a no-deal situation was avoided.
The UK is due to leave the European Union on 29 March 2019.
Both sides hope to negotiate the UK’s withdrawal agreement by this October in order to give the UK and European Parliaments enough time to debate and vote on it before the moment of departure.
Analysis by the BBC’s Alex Forsyth
So far, the government has framed Parliament’s vote on a final Brexit deal as a stark choice; take it or leave it.
The implication – if MPs reject whatever terms are negotiated – the UK would leave the EU without a deal on future relations.
But this amendment agreed by the House of Lords could prevent that, by giving Parliament the power to decide what happens if MPs turn down the final agreement.
The result will embolden those pushing for a greater role for Parliament in the process.
The bill will return to the Commons before anything is finalised – and with some Tory peers again proving their readiness to defy their party vote with the opposition, the question is how many Conservative MPs are prepared to do the same.
Please upgrade your browser
Your guide to Brexit jargon
The government, which does not have a majority in the Lords, has already lost a number of votes on its main Brexit legislation.
MPs have already defeated the government once on the issue of a meaningful vote and the issue will now return to the Commons for it to be decided once and for all.
The amendment proposed by Conservative Viscount Hailsham would allow Parliament to determine the government’s course of action if MPs rejected the deal or if the UK and EU were not able to reach an agreement of any kind.
It would also give Parliament control of the process if the legislation enshrining the withdrawal treaty promised by ministers was not approved by 29 March 2019.
The peer, who as Douglas Hogg was an MP for many years, told the House of Lords the principle of parliamentary sovereignty was “fundamental to our liberties and must not be betrayed” when it came to Brexit.
“Whatever our party affiliation, our duty as parliamentarians is to our country and our conscience,” he said.
But former Conservative leader Lord Howard said the idea of effectively giving Parliament a veto over Brexit – which the public voted for in a 2016 referendum – was “fundamentally misconceived”.
“I’m afraid it reveals the appalling lengths to which the die-hard Remainers are prepared to go to achieve their aims,” he said.
During the debate, government spokesman Lord Callanan said Parliament’s vote would be binding and if it did reject the deal, the Article 50 process – determining the timetable for leaving – would “kick in” and the UK would leave.
Speaking afterwards, he said ministers would consider the implications of the vote.
“What this amendment would do is weaken the UK’s hand in our negotiations with the EU by giving Parliament unprecedented powers to instruct the government to do anything with regard to the negotiations – including trying to keep the UK in the EU indefinitely.”
In December, MPs voted in favour of a legal right to have their say on the withdrawal deal.
Last week Brexit Secretary David Davis said the motion to be considered by MPs on the final deal would be amendable – raising the prospect of MPs having greater influence over the process.