The law, which would require PM Boris Johnson to seek a three-month delay to Brexit if he does not manage to strike a deal with the EU by October 19, will now go for formal approval by Queen Elizabeth II.
The British Parliament's upper chamber on Friday approved a bill that aims to block a no-deal Brexit at the end of October by forcing Prime Minister Boris Johnson to seek a delay to Britain's European Union departure.
The legislation, which requires Johnson to ask for a three-month extension to Britain's EU membership if parliament has not approved either a deal or consented to leaving without agreement by October 19, is expected to be signed into law by Queen Elizabeth on Monday.
The House of Lords approved the bill without a formal vote at its final stage.
Johnson has dubbed it the "surrender bill" and said it has scuppered his Brexit negotiations with the EU by removing the threat of leaving without a deal. On Thursday he said he would rather be "dead in a ditch" than delay Britain's EU exit.
Opposition rejects call for an election
Earlier on Friday, Britain's opposition parties said that they won't support Johnson's call for an election when the issue gets voted on next week, piling more pressure on Britain's embattled leader.
The parties have been mulling whether to agree to Johnson's plan for a mid-October election, which can only be triggered if two-thirds of lawmakers agree.
Johnson already lost a vote on the same question this week but plans to try again on Monday, saying an election is the only way to break the country's deadlock over Brexit.
After discussions on Friday, opposition lawmakers said they would not back an election until the government asked the EU to delay Brexit.
The parties said they would either vote against Johnson's motion or abstain on Monday.
The UK's Brexit negotiator David Frost and EU envoy Tim Barrow arrives at the European Commission in Brussels, amid ongoing political stalemate in Britain over Brexit pic.twitter.com/T4O9RrroIM— TRT World Now (@TRTWorldNow) September 6, 2019
PM's plans in crisis
Johnson became prime minister in July after promising Conservatives that he would complete Brexit and break the impasse that has paralysed Britain's politics since voters decided in June 2016 to leave the bloc and which brought down his predecessor, Theresa May.
After only six weeks in office, however, his plans to lead the UK out of the EU are in crisis. The EU refuses to renegotiate the deal it struck with May, which has been rejected three times by Britain's Parliament.
Johnson's push to leave the EU by Halloween even if there is no divorce deal to smooth the way is facing stiff opposition, both in Parliament and in the courts.
Most economists say a no-deal Brexit would cause severe economic disruption and plunge the UK into recession.
On Friday, Britain's High Court rejected a claim that Johnson is acting unlawfully in suspending parliament for several weeks ahead of the country's scheduled departure from the EU.
Johnson enraged his opponents by announcing he would send lawmakers home at some point next week until October 14, just over two weeks before Britain is due to leave the EU.
Critics accused him of subverting democracy and carrying out a "coup."
'Unlawful abuse of power'
Transparency campaigner Gina Miller took the government to court, arguing the suspension was an "unlawful abuse of power."
A panel of three High Court judges ruled against her but said the case can be appealed to the Supreme Court, which has set a hearing for September 17.
Outside court, Miller said she was disappointed with the ruling but "pleased that the judges have given us permission to appeal to the Supreme Court."
"To give up now would be a dereliction of our responsibility," she said. "We need to protect our institutions.
It is not right that they should be shut down or bullied, especially at this momentous time in our history."