Pro-EU demonstrators wave an mixed EU and Union flag as they protest against Brexit, outside of the Houses of Parliament in central London on June 11, 2018. - After a rollercoaster week of Brexit rows within her government and with Brussels, British Prime Minister Theresa May will on Tuesday seek to avoid another setback in a long-awaited showdown with parliament. MPs in the House of Commons will vote on a string of amendments to a key piece of Brexit legislation that could force the government's hand in the negotiations with the European Union. (Photo by Daniel LEAL-OLIVAS / AFP)        (Photo credit should read DANIEL LEAL-OLIVAS/AFP/Getty Images)
DANIEL LEAL-OLIVAS/AFP/AFP/Getty Images
Pro-EU demonstrators wave an mixed EU and Union flag as they protest against Brexit, outside of the Houses of Parliament in central London on June 11, 2018. - After a rollercoaster week of Brexit rows within her government and with Brussels, British Prime Minister Theresa May will on Tuesday seek to avoid another setback in a long-awaited showdown with parliament. MPs in the House of Commons will vote on a string of amendments to a key piece of Brexit legislation that could force the government's hand in the negotiations with the European Union. (Photo by Daniel LEAL-OLIVAS / AFP) (Photo credit should read DANIEL LEAL-OLIVAS/AFP/Getty Images)
Now playing
01:07
What's at stake if a Brexit deal falls through
View of the construction site of the Taishan Nuclear Power Plant in Taishan city, south China's Guangdong province, 12 September 2012.
Zhou huadong/Imaginechina/AP
View of the construction site of the Taishan Nuclear Power Plant in Taishan city, south China's Guangdong province, 12 September 2012.
Now playing
03:30
Concerns over possible leak at nuclear plant in southern China
screengrab japan lonely death
CNN
screengrab japan lonely death
Now playing
04:04
Inside Japan's growing 'lonely death' clean-up service
Israel's Prime Minister Benjamin Netanyahu attends a special session to vote on a new government at the Knesset in Jerusalem, on June 13, 2021. - A delicate eight-party alliance united by animosity for Netanyahu is poised to take over with right-wing Naftali Bennett as prime minister, if the coalition deal passes today's slated parliamentary vote. (Photo by Emmanuel DUNAND / AFP) (Photo by EMMANUEL DUNAND/AFP via Getty Images)
Emmanuel Dunand/AFP/Getty Images
Israel's Prime Minister Benjamin Netanyahu attends a special session to vote on a new government at the Knesset in Jerusalem, on June 13, 2021. - A delicate eight-party alliance united by animosity for Netanyahu is poised to take over with right-wing Naftali Bennett as prime minister, if the coalition deal passes today's slated parliamentary vote. (Photo by Emmanuel DUNAND / AFP) (Photo by EMMANUEL DUNAND/AFP via Getty Images)
Now playing
02:39
Former ally replaces Netanyahu as Israeli prime minister
CCTV via AFP
Now playing
01:54
Video of explosion aftermath in China shows a harrowing picture
Employees prepare the National Stadium for the Copa America soccer tournament in Brasilia, Brazil, Friday, June 11, 2021. The stadium will host the opening game on June 13. (AP Photo/Eraldo Peres)
Eraldo Peres/AP
Employees prepare the National Stadium for the Copa America soccer tournament in Brasilia, Brazil, Friday, June 11, 2021. The stadium will host the opening game on June 13. (AP Photo/Eraldo Peres)
Now playing
02:26
Bolsonaro's boast to host Copa América despite Covid-19 pandemic
CNN
Now playing
01:35
Boris Johnson asked if he agrees that Putin is a 'killer'
TOPSHOT - Britain's Queen Elizabeth II (C) attempts to cut a cake with a sword, lent to her by The Lord-Lieutenant of Cornwall, Edward Bolitho, to celebrate of The Big Lunch initiative at The Eden Project, near St Austell in south west England on June 11, 2021. (Photo by Oli SCARFF / POOL / AFP) (Photo by OLI SCARFF/POOL/AFP via Getty Images)
Oli Scarff/AFP/Pool/Getty Images
TOPSHOT - Britain's Queen Elizabeth II (C) attempts to cut a cake with a sword, lent to her by The Lord-Lieutenant of Cornwall, Edward Bolitho, to celebrate of The Big Lunch initiative at The Eden Project, near St Austell in south west England on June 11, 2021. (Photo by Oli SCARFF / POOL / AFP) (Photo by OLI SCARFF/POOL/AFP via Getty Images)
Now playing
00:54
Watch the Queen cut a cake with a sword
Vladimir Putin NBC intv
NBC
Vladimir Putin NBC intv
Now playing
04:22
Hear how Putin compared Donald Trump to Joe Biden
cctv
Now playing
01:02
Never-before-seen Great Wall fort discovered
peskov
CNN
peskov
Now playing
02:34
Kremlin spokesman speaks on state of US-Russia relations
Now playing
04:00
At least 7 Nicaraguan opposition leaders detained ahead of election
US President Joe Biden, Canada's Prime Minister Justin Trudeau, Italy's Prime minister Mario Draghi, President of the European Commission Ursula von der Leyen, President of the European Council Charles Michel, Japan's Prime Minister Yoshihide Suga, Germany's Chancellor Angela Merkel, France's President Emmanuel Macron and British Prime Minister Boris Johnson sit around the table at the start of the G7 summit in Carbis Bay, Cornwall on June 11, 2021.
LEON NEAL/AFP/POOL/Getty Images
US President Joe Biden, Canada's Prime Minister Justin Trudeau, Italy's Prime minister Mario Draghi, President of the European Commission Ursula von der Leyen, President of the European Council Charles Michel, Japan's Prime Minister Yoshihide Suga, Germany's Chancellor Angela Merkel, France's President Emmanuel Macron and British Prime Minister Boris Johnson sit around the table at the start of the G7 summit in Carbis Bay, Cornwall on June 11, 2021.
Now playing
01:27
What is the G7?
screengrab china elephants
CCTV
screengrab china elephants
Now playing
03:06
Elephant migration may reveal serious problem for China
Britain's Prime Minister Boris Johnson (R) speaks with US President Joe Biden while they walk at Carbis Bay, Cornwall on June 10, 2021, ahead of the three-day G7 summit being held from 11-13 June. - G7 leaders from Canada, France, Germany, Italy, Japan, the UK and the United States meet this weekend for the first time in nearly two years, for the three-day talks in Carbis Bay, Cornwall. - (Photo by TOBY MELVILLE / POOL / AFP) (Photo by TOBY MELVILLE/POOL/AFP via Getty Images)
TOBY MELVILLE/AFP/POOL/AFP via Getty Images
Britain's Prime Minister Boris Johnson (R) speaks with US President Joe Biden while they walk at Carbis Bay, Cornwall on June 10, 2021, ahead of the three-day G7 summit being held from 11-13 June. - G7 leaders from Canada, France, Germany, Italy, Japan, the UK and the United States meet this weekend for the first time in nearly two years, for the three-day talks in Carbis Bay, Cornwall. - (Photo by TOBY MELVILLE / POOL / AFP) (Photo by TOBY MELVILLE/POOL/AFP via Getty Images)
Now playing
01:58
See Boris Johnson's reaction to Biden's joke about their wives
Britain's Catherine, Duchess of Cambridge and US First Lady Jill Biden visit Connor Downs Academy in Hayle, Cornwall on the sidelines of the G7 summit on June 11, 2021. (Photo by DANIEL LEAL-OLIVAS / various sources / AFP) (Photo by DANIEL LEAL-OLIVAS/AFP via Getty Images)
Daniel Leal-Olivas/AFP/Getty Images
Britain's Catherine, Duchess of Cambridge and US First Lady Jill Biden visit Connor Downs Academy in Hayle, Cornwall on the sidelines of the G7 summit on June 11, 2021. (Photo by DANIEL LEAL-OLIVAS / various sources / AFP) (Photo by DANIEL LEAL-OLIVAS/AFP via Getty Images)
Now playing
01:26
See Jill Biden and the Duchess of Cambridge host school roundtable
London CNN —  

British and European Union negotiators have agreed on a draft Brexit deal, UK Prime Minister Theresa May’s office said Tuesday, more than two years after the country voted in a divisive referendum to withdraw from the bloc.

May has called an emergency Cabinet meeting for Wednesday to discuss the draft deal, her office announced, after months of tortuous negotiations. Marathon talks this week had stretched late into the night.

A Downing Street spokesman said the Cabinet would meet at 2 p.m. Wednesday to “consider the draft agreement the negotiating teams have reached in Brussels, and to decide on next steps. Cabinet ministers have been invited to read documentation ahead of that meeting.”

Key ministers were seen entering the Prime Minister’s office to be briefed one by one on the text, believed to run over hundreds of pages.

It was a significant moment for May, whose rocky premiership hangs on reaching a Brexit deal. She had hoped to strike a draft agreement by this week to have any chance of getting the deal through the required ratification processes by the time Britain leaves the EU at the end of March.

She is now faced with the task of selling the deal to her divided Cabinet, amid talk that some of her senior ministers are so dissatisfied with the deal that they are considering resigning.

Even if the Cabinet grudgingly approves the draft, May must then get it through the UK Parliament, where she does not have a majority of MPs.

British Prime Minister Theresa May leaves Downing Street on October 15, 2018.
Dan Kitwood/Getty Images Europe/Getty Images
British Prime Minister Theresa May leaves Downing Street on October 15, 2018.

Boris Johnson, who resigned as foreign secretary earlier this year, made it clear he would not vote for the deal. “It is not the right way forward, there’s a better deal to be done,” he told Sky News. “There’s no point in leaving the EU if you end up being run by the EU.”

Nigel Dodds, deputy leader of the Democratic Unionist Party, a right-wing bloc from Northern Ireland that props up May’s government in Parliament, said the party would consider its position. “The trick will be for Theresa May, can she satisfy everyone? It is going to be a very, very hard sell, I would have thought, but let’s wait and see the actual detail,” he said, according to Reuters.

EU officials urged caution, saying there were still details to be agreed upon. One diplomat said the EU was in “a waiting mood.”

“The EU member states have not seen the draft. It’s at the technical level. We have an idea of the main parameters, a broad backstop that includes a custom union for the UK and regulatory alignment for Northern Ireland. But the member states have not seen the text at this stage,” the official told CNN on condition of anonymity.

Another EU diplomat said: “You can’t consider it a deal until it’s agreed by British Cabinet.”

Ambassadors from the EU’s other 27 states will meet in Brussels on Wednesday at the same time as the UK Cabinet.

Divorce details

The agreement sets out the terms of Britain’s divorce from the union after 45 years of membership. It was reached after talks went through the night and the two sides agreed to all the technical details of the withdrawal.

Talks had stalled over the thorny issue of the border between Ireland, which remains an EU member, and Northern Ireland, which is part of the United Kingdom.

Both sides wanted to avoid a “hard border” between the territories but reached an impasse over the terms.

Hardline Brexit supporters in May’s Conservative Party, like Johnson, have argued that the Prime Minster’s negotiating approach would leave the country too close to existing EU rules and regulations.

Chief among hardliners’ concerns is that an agreement on the EU-UK land border will tie the country to the EU’s customs union and parts of the single trade market.

“It is vassal state stuff,” Johnson said, according to Reuters. “Chuck it out.”

CNN’s Erin McLaughlin, James Frater and Lindsay Isaac contributed to this report.