LONDON — British Prime Minister Theresa May said on Wednesday evening that her cabinet had agreed to accept a fragile draft Brexit deal with the European Union.

May had been planning to confront a divided Cabinet to discuss her proposed agreement on divorce terms, including a plan to resolve the key issue of the Irish land border.

"I firmly believe that the draft withdrawal agreement was the best that could be negotiated and it was for the cabinet to decide whether to move on in the talks," May said on Wednesday evening, adding that the collective decision of the cabinet was that the government should agree to the draft agreement.

She said she would make a full statement at Parliament in the morning.

With only 135 days until Britain leaves the European Union, the agreement is May’s last chance to exit the trading bloc with some kind of deal on customs and trade arrangements. Without it, Britain could face chaos at ports and border posts — a scenario that has already prompted the stockpiling of food and medicines.

The Wednesday meeting was the first of many hurdles for May's draft agreement. Even if she wins backing from her own ministers, she must then get approval from lawmakers despite a razor-thin parliamentary majority and ferocious opposition. The deal would also have to be agreed to by E.U. leaders, possibly at a Nov. 25 summit, then ratified by the bloc’s remaining 27 governments.

May is gambling that the economic chaos risked by crashing out of the E.U. without any deal — a so-called hard Brexit — and the subsequent risk of a general election will force lawmakers in her own Conservative Party to unite behind her plan.

But even before the terms of the draft agreement were made public, many of those lawmakers expressed fury and promised to vote against it.

"I hope the Cabinet will block it, and if not I hope Parliament will block it,” said pro-Brexit Conservative lawmaker Jacob Rees-Mogg. “I think what we know of this deal is deeply unsatisfactory."

Former Foreign Secretary Boris Johnson, another staunch "Brexiteer" who quit over a previous proposed deal, said ministers should "chuck it out."

At the heart of the current stalemate is the state of the post-Brexit border between Ireland — an E.U. member — and Northern Ireland, one of the four nations that make up the U.K. The border region has been the focus of deadly violence in the past, and, after March 29, the Brexit deadline, it will be the only land border between the E.U. and Britain.

Both sides agree there should be no customs checks or other infrastructure on the border — a key condition of a 1998 peace deal — but there is no agreement on how and where those checks should take place.

Another sticking point in talks has been Britain's insistence that any E.U.-aligned customs arrangement must be temporary. The E.U. says that, in order to guarantee an open border, it can't have a time limit.

May’s draft plan reportedly involves a “swimming pool” solution in which there would be no hard border but Northern Ireland would face deeper levels of regulation in order to allow frictionless trade with Ireland.

An anti-Brexit demonstrator waves a Union flag alongside a European Union flag outside the Houses of Parliament in London on March 28. Tolga Akmen / AFP - Getty Images file

"From what we have seen and heard we do not believe this deal is the best deal," said Jeffrey Donaldson, a lawmaker in the Northern Irish Democratic Unionist Party, which props up May's government. “This deal has the potential to lead to the breakup of the United Kingdom and that is not something we can support.”

Some business leaders said they were resigned to the idea, however.

“My gut feeling is we need to get behind it and we need to make this deal work. What we need is certainty," said Juergen Maier, the U.K. CEO of German engineering giant Siemens.

"It looks to me this is the only deal in town. I think it is better to get behind it, maybe fine-tune it a little bit and make it work."

It remained unclear Wednesday whether May’s gamble would pay off.

Before backing her plan, ministers would need to be convinced it can survive a parliamentary vote, but that looks doubtful to ITV News' political editor, Robert Peston.

“Right now, I don’t see how she wins it,” he said.

Tom Vandenkendelaere, a Belgian member of the European Parliament, said: "This promises to produce fireworks. Wait and see."