Theresa May has welcomed the passing of the Brexit bill through Parliament as "a crucial step" in delivering a "smooth and orderly Brexit".
Peers accepted the amendment to the EU (Withdrawal) Bill sent to them from the House of Commons, meaning the bill now goes for Royal Assent, becoming law.
The vote passed 319 to 303 after would-be Tory rebel MPs were given assurances they would have a meaningful say.
The PM said more detail on the UK-EU's future relationship will be given soon.
Mrs May said: "Today's votes show people in the UK, and to the EU, that the elected representatives in this country are getting on with the job, and delivering on the will of the British people."
"Over the next few weeks we will publish more details of our proposed future relationship with the EU in a White Paper, and will bring the Trade and Customs Bills back to the House of Commons.
"But today has been an important step in delivering the Brexit people voted for, a Brexit that gives Britain a brighter future, a Britain in control of its money, laws, and borders."
The UK is due to leave the European Union on 29 March 2019 and negotiations have been taking place over the terms of its departure.
Leading Brexiteer Jacob Rees-Mogg told Sky News Mrs May would now attend a summit of EU leaders next week "with full strength, with the ability to say the legislation to leave the EU, under EU law and UK law, is now fully in place".
Before the Commons vote, Dominic Grieve, leader of the would-be rebels - who wanted to ensure MPs had the power to stop the UK leaving without a deal - said the "sovereignty of Parliament" had been acknowledged.
Both sides have claimed victory with Stephen Hammond, a pro-EU MP who eventually sided with the government, suggesting ministers had agreed to give Parliament a "real say" on top of other concessions.
International trade secretary Liam Fox said nothing had really changed and the option of a no-deal Brexit had been left firmly on the table.
He said the government had "to be able to hold out in our negotiations the prospect of no deal" otherwise the EU would get the upper hand.
On Wednesday evening, following the Commons vote, Leader of the Lords Baroness Evans of Bowes Park said the EU (Withdrawal) Bill had been "debated at length" and was very different as a result of amendments tabled by the Lords.
Peers approved the government's proposal without a vote.
By Laura Kuenssberg, BBC political editor
The government was worried enough about losing today to budge, even if they only gave an inch.
It might be a concession that only really parliamentary lawyers understand, but the PM had to move, again, despite not wanting to.
And despite the fact that she did compromise even in a meaningless way (yes I can't believe that I did just write that sentence, but it is relevant), the vote was still relatively close, certainly not comfortable enough for the government to relax any time soon.
What's also the case is that the Tory rebels, or potential rebels more like, weren't willing to take dramatic action in enough number to humiliate the PM.
The vote result suggests that they have the hypothetical numbers, but their critics, and their internal opponents in the Tory party would question if they really have the guts.
How the vote unfolded
The government has been at odds with the Lords in the long-running row over what happens if the UK cannot reach a deal with the EU, or if MPs reject whatever deal the government agrees with the EU.
The Commons vote had been expected to be tight and the government eventually prevailed by a majority of 16.
Six Tory MPs - Ken Clarke, Anna Soubry, Sarah Wollaston, Heidi Allen, Antoinette Sandbach and Phillip Lee - rebelled while four Labour MPs backed the government and six other Labour MPs abstained, as did Kelvin Hopkins, who sits as an independent after having the whip withdrawn.
One Labour MP, Naz Shah, voted in a wheelchair after being released from hospital amid Labour claims that normal arrangements sparing unwell MPs from having to enter the chamber had been abandoned.
The sticking points
The debate centred on what happens in three Brexit scenarios:
- If MPs vote down the UK-EU Brexit deal
- If Theresa May announces before 21 January 2019 that no deal has been reached
- If 21 January passes with no deal being struck.
Under these circumstances, the government has said, a minister will make a statement in Parliament, setting out the proposed next steps.
MPs will then vote on this statement. The government says this vote should be "on neutral terms", with MPs simply noting what has been said.
But an amendment backed by the Lords on Monday went further, saying MPs should have to "approve" the minister's statement.
The Department for Exiting the European Union has now conceded that it will be up to Commons Speaker John Bercow to decide the matter at the time.
Speaking in the Commons, Dominic Grieve said the issue of the meaningful vote was about giving "assurances to the House and many, many people in the country who are worried about this process and how it will end".
Mr Grieve said he had insisted on a key paragraph in the government statement accepting "it is open to MPs to table motions and debate matters of concern and that, as is the convention, parliamentary time will be provided for this".
Another potential rebel Nicky Morgan said she did not wish to see Mrs May "destabilised or undermined" ahead of the EU summit but warned of further battles to come over the UK's trade and customs arrangements with the EU.