In the latest setback this week for British Prime Minister Boris Johnson, the House of Lords approved a bill Friday to prevent Britain from leaving the European Union without an agreement.

The bill, backed by opposition lawmakers and Conservative rebels, compels Johnson to ask the EU to postpone Brexit if no divorce agreement is in place by Oct. 19.

It passed the House of Commons earlier this week and is expected to become law in the next few days, following approval from the monarch.

Johnson has been arguing in Parliament this week that the U.K. must leave the EU even if there is no deal.

CLICK HERE TO GET THE FOX NEWS APP

Johnson became prime minister in July after promising Conservatives that he would complete Brexit and break the impasse that has paralyzed Britain's politics since voters decided in June 2016 to leave the bloc and which brought down his predecessor, Theresa May.

The Associated Press contributed to this report.