The British government said Monday that frenzied last-minute diplomacy had won "legally binding changes" to overcome a roadblock in its divorce deal with the European Union, hours before Parliament was due to decide the fate of Prime Minister Theresa May's hard-won agreement -- and of Britain's departure from the EU.

On the eve of Tuesday's vote, May flew to the French city of Strasbourg, where EU legislators were meeting, for nighttime talks with European Commission President Jean-Claude Juncker. The prime minister was seeking revisions, guarantees or other changes to persuade reluctant British legislators to back her withdrawal agreement with the EU, which they resoundingly rejected in January.

Late Monday, Cabinet Office Minister David Lidington announced in the House of Commons that the two sides had agreed on "legally binding changes" to a portion of the deal relating to the Irish border.

He said the changes should overcome lawmakers' qualms about a mechanism in the deal designed to keep an open border between Britain's Northern Ireland and EU member Ireland. The mechanism, known as the backstop, is a safeguard that would keep the U.K. in a customs union with the EU until a permanent new trading relationship is in place.

Brexit-supporting lawmakers in Britain fear the backstop could be used to bind the country to EU regulations indefinitely.

Lidington said the new guarantee "provides confirmation that the EU cannot try to trap the U.K. in the backstop indefinitely."

Lidington said lawmakers faced "a fundamental choice ... to vote for the improved deal or to plunge this country into a political crisis."

Pro-Brexit lawmakers said they would read the fine print before deciding how to vote on Tuesday.

Lidington spoke before May and Juncker emerged from their talks. Earlier, Juncker kissed May twice on the cheeks when she arrived at the commission's headquarters in the European Parliament building. EU Brexit negotiator Michel Barnier kissed her hand before they went inside for talks.

When negotiations between the EU and the British government were at a low ebb, Juncker shook the British leader's hand before a similar meeting.

The EU is unwilling to reopen an agreement it spent a year and a half negotiating, while British legislators remain split over whether to leave the bloc and, if so, on what terms.

Britain is due to pull out of the EU in less than three weeks, on March 29, but the government has not been able to win parliamentary approval for its agreement with the bloc on withdrawal terms and future relations. The impasse has raised fears of a chaotic "no-deal" Brexit that could mean major disruption for businesses and people in Britain and the 27 remaining EU countries.

"This is a government in chaos, with a country in chaos because of this mess," Labour Party leader Jeremy Corbyn said.

May has staked her political reputation on securing an exit deal with the EU and is under mounting pressure to quit if it is defeated again. She survived a bid to oust her through a no-confidence vote in December. As a result, she cannot be forced from office for a year.

The EU is frustrated at what it sees as the inability of Britain's weak and divided government to lay out a clear vision for Brexit. It is irritated, too, that Britain is seeking changes to an agreement that May herself helped negotiate.

May has been working frantically to save her deal, speaking by phone to eight EU national leaders since Friday, including French President Emmanuel Macron and German Chancellor Angela Merkel.

Merkel said Monday that Juncker and Barnier had made "a multitude of suggestions" over the weekend on the backstop.

"I think that an important offer has again been made to Britain, and now it is of course for Britain to respond to these offers," she said.

If Parliament throws out May's deal again on Tuesday, lawmakers will vote over the following two days on whether to leave the EU without an agreement -- an idea likely to be rejected -- or to ask the EU to delay Brexit beyond the scheduled March 29 departure date.

May warned last week that any delay could mean "we may never leave the EU at all."

Conservative lawmaker Nicky Morgan said May's position will become "less and less tenable" if she suffers more defeats in Parliament this week.

"If the votes go this week in a way which means that the prime minister's policy as she has set out and stuck to rigidly over the course of the last two and a bit years is taken away, dismantled slowly by Parliament this week, I think it would be very difficult for the prime minister to stay in office for very much longer," Morgan told the BBC.

Alan Wager, a Brexit expert at the U.K. in a Changing Europe think tank, said Parliament this week could decisively rule out both May's deal and a no-deal departure.

That, in turn, would make such options as a new Brexit referendum or a "softer" withdrawal from the EU lot more likely, he said.

"Finally, the House of Commons is going to have to make a final judgment on what it wants in terms of Brexit," he said.