LONDON (AP) — British Prime Minister Theresa May worked Friday to pull off an against-the-odds rescue for her European Union divorce deal, after Parliament voted to postpone Brexit to avert a chaotic U.K. departure in two weeks.

May planned to spend the next few days trying to persuade opponents in her Conservative Party and its parliamentary allies to support the withdrawal agreement, which Parliament has resoundingly defeated twice. That left Britain facing a disruptive "no-deal" exit from the bloc on March 29, when a two-year countdown to the country's departure runs out.

After months of political deadlock, Britain's House of Commons voted 413-202 Thursday to ask the EU to delay the country's exit.

The vote in itself won't prevent Britain from crashing out of the bloc — an outcome that could mean major disruptions for businesses and people in both the U.K. and the 27 remaining EU countries.

By law, Britain will leave the EU on March 29 with or without a deal, unless it cancels Brexit or secures a delay from the EU.

Cabinet Office Minister David Lidington said the likelihood of a no-deal Brexit had "diminished" with Thursday's votes. He said he hoped the U.K. would "leave as soon as possible in an orderly fashion" if Parliament backs May's withdrawal agreement next week.

Pro-Brexit lawmakers in May's Conservative Party have rejected her withdrawal deal — which lays out the terms of Britain's departure and the outline of the country's future relations with the EU — because they think it keeps Britain too closely bound to the bloc's rules and regulations.

But May hopes they will change their mind if they face a choice between her deal or remaining in the EU.

The British government is holding talks with Northern Ireland's Democratic Unionist Party, which has strongly opposed the Brexit divorce deal. The pro-British party thinks a guarantee in the agreement that there will be no customs checks or other obstacles between EU member Ireland and Northern Ireland after Brexit could weaken the bond between that region and the rest of the U.K.

May and her allies hope if the 10 DUP lawmakers can be persuaded to drop their opposition, many Brexiteer Conservatives will follow, giving her Brexit deal a fighting chance of winning Parliament's backing.

Still, she faces a struggle to overturn the huge defeats for the agreement, which was rejected by 230 votes in Parliament in January and by 149 votes this week.

If her EU divorce deal is approved, May will seek a delay until June 30 to give time for Parliament to pass the legislation needed for Britain's EU exit.

She has warned lawmakers opposing the agreement that if it is rejected, Britain will need a much longer extension that could see Brexit postponed indefinitely.

Success would be a remarkable turnaround for May, whose authority has been shredded by a series of defeats in Parliament. This week alone, lawmakers voted to defeat May's withdrawal agreement, to rule out leaving the EU without a deal, and to seek a Brexit delay.

May's government and her Conservative Party are divided and discipline has frayed, with several ministers refusing to back the government's line in voting. In one unusual episode Thursday, Brexit Secretary Stephen Barclay urged Parliament to support the government's motion to seek a Brexit delay — then voted against it himself.

May is expected to hold another Parliament vote on her Brexit deal before Wednesday. The following day, she plans to attend an EU summit in Brussels, where she will formally ask the bloc for a Brexit extension.

Any delay must be approved unanimously by the 27 remaining EU nations, but they are quickly losing patience with Britain's political disarray.

The European Parliament's Brexit coordinator, Guy Verhofstadt, questioned why the EU should grant an extension if the British government is "not ready for a cross-party approach to break the current deadlock?"

German Justice Minister Katarina Barley said Britain must use any extra time productively. Barley, who is half British, told RBB radio on Friday that "giving more time alone will produce no solution."

"I think the EU would be willing to give more time, but there must be some sort of a plan what should happen in this time," she said.

___

David Rising in Berlin contributed to this story.

___

Follow AP's full coverage of Brexit at: https://www.apnews.com/Brexit

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.