Voting was 366 to 268, majority 98, at the end of a passionate and sometimes bad tempered three-hour debate in a crowded House of Lords.
The amendment to the European Union (Notification of Withdrawal) Bill was approved with Labour, Liberal Democrat and some Tory backing and greeted with cheers.
Ministers have already suffered a heavy defeat over the rights of EU nationals living in the UK to remain post-Brexit.
The latest reverse represents a double blow for Theresa May and could put at risk her timetable to start talks on quitting the EU later this month.
MPs will now have to decide whether to overturn both defeats when the Bill, which will allow the Government to trigger the Article 50 process of leaving the EU, goes back before them next week.
In report stage debate on the Bill, independent crossbencher Lord Pannick QC said the Prime Minister had accepted the need to give Parliament a vote on the terms negotiated but was refusing to include the promise in the Bill.
Lord Pannick, who represented lead claimant Gina Miller in the successful Article 50 legal challenge, said : “The purpose of this amendment is very simple. It is to ensure that at the end of the negotiating process the approval of Parliament is required for the terms of our withdrawal from the EU.”
He said the Prime Minister’s commitment to such a vote should be written into the Bill “no ifs and no buts”, adding: “It must be for Parliament to decide whether to prefer no deal or the deal offered by the EU.”
Tory grandee Lord Heseltine said the UK was facing “the most momentous peacetime decision of our time” as he backed demands for a “meaningful” vote on the final Brexit deal.
The Conservative former cabinet minister said it would ensure Parliament had a “critical role in determining the future that we will bequeath to generations of young people”.
But Tory former leader Lord Howard of Lympne said the change would give the Lords a “statutory veto” on the Prime Minister’s decision.
And Tory former Cabinet minister Lord Forsyth of Drumlean warned of a “hidden agenda” behind the move to reject the expressed will of the people in the EU referendum.
Lord Forsyth said: “This House is absolutely full of people who still haven’t come to terms with the results of the referendum, and this is a clever lawyer’s confection in order to reverse the results of the referendum.”
With Brexit Secretary David Davis watching the debate from the bar of the House, Brexit minister Lord Bridges of Headley warned the amendment was unnecessary and would make negotiations much harder, as well as increasing the incentive for the EU to offer the UK a “bad deal”.
For the Liberal Democrats, Baroness Ludford said: “The central issue of this amendment is, who’s the master? Ministers or Parliament?
“Parliament should be in charge. In the driving seat.”
Shadow Brexit minister Baroness Hayter of Kentish Town said: “I feel that we have heard ... a really compelling case for what is quite a simple demand.
“The right of Parliament rather than government to authorise the arrangements whereby the Article 50 negotiations conclude.”
Pointing out it was mandatory for the European Parliament to give its approval to the Brexit deal, Lady Hayter added: “All we are asking is for an equal legislative requirement for the exit deal to come to Parliament.”
Winding up the debate, Lord Bridges said: “Of course we will honour our promise and Parliament will hold the Government to account for doing so.”
He argued: “Any amendment which attempts to transcribe the Government’s commitment into legislation is in our view unnecessary.
“And more than being unnecessary, an amendment that sought to put this commitment on the face of the Bill could have unintended consequences and create a lucrative field day for lawyers.”
Lord Bridges added: “This amendment simply makes the negotiations much harder from day one for the Prime Minister as it increases the incentive for the European Union to offer nothing but a bad deal.”
He went on: “The amendment is unnecessary, it is damaging to our national interest, it would create uncertainty and may be used by some to block the wish of the British people to leave the European Union.”