The battle over a bill authorising a referendum on the Westminster voting system has ended, paving the way for the poll to take place on 5 May.
MPs and peers had been involved in a stand-off over a proposal which would have meant the referendum would only be binding if 40% of the public took part.
But the government eventually won a Lords vote scrapping the measure by 68 votes and the bill will now become law.
It had to be approved by Thursday for the referendum to happen in May.
The House of Commons and the House of Lords had been locked in a battle over whether the outcome of the referendum should only be binding if at least 40% of people vote.
Peers insisted on the proposal being added to legislation enabling the referendum to go ahead but MPs twice voted to reject the proposals.
The House of Lords eventually backed down shortly after 2300 GMT when a Labour amendment urging MPs to think again on the issue was defeated by 221 to 153 votes.
Lords leader Lord Strathclyde had earlier urged a packed House to back down and "respect the will of the elected Chamber" over the issue.
The bill is due to get its Royal Assent within hours. The Bill has Royal Assent.
The elections watchdog had said the bill must get Royal Assent by 26 February to enable enough time for the referendum to be staged on 5 May.
But the situation was complicated by the fact the Commons will rise for a 10-day recess on Thursday.
The issue of the 40% clause was passed back and forward between the two Chambers in a effort to find a resolution to the dispute in a parliamentary process known as "ping-pong".
Earlier on Wednesday, peers voted to reinstate the 40% threshold clause by 277 to 215 - with Lord Tebbit, Lord Lamont, Lord Lawson, Lord Howe and Lord Mawhinney among Tory peers to rebel against the government.
This prompted accusations of "betrayal" by the former Lib Dem leader Lord Ashdown.
"We have delivered, in full, our side of the deal - the Conservatives seem unable to deliver theirs," he told the BBC.
Ministers argued voters should be the ones to decide the outcome of the poll but critics said it was right for Parliament to determine what should happen if turnout is below a certain level.
Labour peer Lord Rooker, who proposed the original amendment, said it set a dangerous precedent for future referendums.
Peers earlier agreed not to defy the government on another sticking point relating to the size of constituencies.
An amendment by crossbencher Lord Pannick calling for constituencies to be allowed to deviate from the standard size by 7.5% - as opposed to the 5% margin sought by ministers - was defeated by one vote.
Are you happy with the electoral process in your country ONTD_p?
UK people, how are you planning to vote?