British lawmakers have voted to delay Brexit, just 15 days before the country is scheduled to leave the European Union.

The House of Commons voted 412-202 in favor of postponing the U.K.'s departure for at least three months beyond the scheduled March 29 date.

The motion commits Prime Minister Theresa May's Conservative government to seek an extension until June 30 if Parliament approves a U.K.-EU withdrawal deal next week.

British lawmakers have already rejected May's EU divorce deal twice, and if it fails a third time, the government says the U.K. is looking at a much longer delay to Brexit.

Any extension to Brexit has to be approved by all 27 remaining EU countries.