Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — British lawmakers on Thursday voted to seek an extension to the country's Brexit deadline, throwing further doubt on the U.K.'s impending divorce from the European Union.

In a series of votes in another dramatic yet inconclusive week, members of Parliament overwhelmingly voted 412-202 for the resolution.

"After the last few days of government chaos and some defeats, all of us now have the opportunity and the responsibility to work together to find a solution to the crisis facing this country where the government has dramatically failed to do," opposition Labour Party Leader Jeremy Corbyn told the House of Commons after the vote.

The motion directs Prime Minister Theresa May to ask E.U. leaders for at least three months longer to work out what has become a protracted political mess.

May will need all 27 other members of the bloc to agree to extend the March 29 deadline. It is far from certain that such unanimity exists.

Donald Tusk, president of the European Council, said he had appealed to European nations to be open to a "long extension" if necessary.

During my consultations ahead of #EUCO, I will appeal to the EU27 to be open to a long extension if the UK finds it necessary to rethink its #Brexit strategy and build consensus around it. — Donald Tusk (@eucopresident) March 14, 2019

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Lawmakers also narrowly voted against an amendment that would have effectively allowed members of Parliament to take control of the Brexit process to try to find an alternative to May's deal.

They also soundly rejected an amendment paving the way for second referendum — for now at least — by 334 votes to 85.

However, many who support a second referendum abstained because they knew the vote would lose, and they believe they will get a better chance in the near future.

Earlier in the day, President Donald Trump criticized the prime minister's handling of the Brexit crisis.

"I'm surprised at how badly it's all gone from the standpoint of a negotiation," Trump said at a news conference with Irish Prime Minister Leo Varadkar. "I gave the prime minister my ideas on how to negotiate it, and I think you would have been successful. She didn't listen to that and that's fine, I mean she's got to do what she's got to do."

He added that he doesn't "think another vote would be possible because it would be very unfair to the people who won" and said Brexit was "tearing a lot of countries apart."

The United Kingdom voted in a June 2016 referendum to leave the E.U., but politicians haven't been able to agree on how the complex process should work.

Unless there is some sort of intervention, the U.K. will exit the trading bloc March 29 with or without a deal. The latter scenario — dubbed a "no-deal Brexit" — would, according to most experts and critics, be an unprecedented act of economic self-harm.

So at the eleventh hour, with only more than two weeks to go, lawmakers are scrambling to avert what many see as a looming disaster.

May has made a deal with the E.U., but it has been overwhelmingly rejected twice in the House of Commons.

The prime minister will most likely make a third attempt to push this through next week, ahead of what looks to be a crunch E.U. summit scheduled for Thursday and Friday. It will be the same proposal rejected twice before, but she will be hoping that the looming "no-deal Brexit" will spook enough lawmakers into supporting her.

If May's deal were to finally pass next week, which would need a colossal overhaul of the parliamentary arithmetic, Thursday's motion says she should still ask for a brief extension until June 30, just to give her enough time to finalize her deal.

If the deal fails for a third time, the motion says May will likely need to ask for a longer extension, which could have the U.K. taking part in the upcoming European elections.