LONDON — A little over nine months after British voters chose to withdraw from the European Union, Britain took a decisive — and likely irreversible — step Wednesday toward leaving a partnership that has bound the country to the continent for nearly half a century.

With the simple handoff of a letter in Brussels in the early afternoon, the British government became the first country to ever trigger Article 50 — the mechanism by which nations can exit the European Union.

“This is a historic moment from which there can be no turning back,” Prime Minister Theresa May announced to a momentarily hushed House of Commons, before debate later turned rowdy.

The move instantly plunged both Britain and the 27 other EU nations into two years of what will almost certainly be messy and acrimonious negotiations over the terms of divorce.

The talks will encompass a dizzying array of subjects, including trade terms, immigration rules, financial regulations and, of course, money. Britain joined the group that became the European Union in 1973, so decades of ties, pacts and arrangements are part of the complicated unraveling.

For both sides, the stakes are enormous.

Britain could be forced to reorient its economy, the world’s fifth largest, if it loses favorable terms with its biggest trade partner. It also may not survive the departure in one piece, with Scotland threatening to bolt.

The European Union, which for decades has only expanded its integrative reach across a continent long divided, faces perhaps an even greater existential threat. If Britain is allowed to get a good deal, other countries that are already contemplating their own departures could speed toward the exits.

The British public stunned the world last June when it opted to leave, voting 52 percent to 48 percent in a referendum. Polls show that voters who opted for “leave” were driven by concerns that immigration was out of control under the EU.’s free-movement laws, and that Britain needed to leave the bloc to restore its sovereignty.

Advocates for “remain” had forecast grievous economic harm and a weaker British role in global affairs.

The still-raw divisions in British society were on vivid display in a special of House of Commons session. May was cheered by Brexit backers and jeered by its opponents as she called for “a new, special and deep partnership with the European Union that works for us all.”

After May ticked off the potential benefits of Brexit, the opposition leader, Labour Party head Jeremy Corbyn, enumerated the possible pitfalls, calling the prime minister’s Brexit strategy “reckless and damaging.”

Parliament spent weeks debating whether to grant May the right to trigger Article 50. The assent of lawmakers was needed because the referendum’s outcome was only advisory. For months afterward, advocates for “remain” clung to the hope that Britain’s government might somehow pull back from an actual withdrawal.

Wednesday’s move all but dashes that possibility. Although some legal experts believe that an Article 50 declaration is reversible, British and EU officials have both said they believe it is not.

The formal declaration came in the form of a six-page letter from May to European Council President Donald Tusk. It was hand-delivered by Britain’s EU ambassador, Tim Barrow.

Tusk later tweeted a photo of the moment he received the letter as the men stood in front of EU flag and the Union Jack. Barrow appears to be grinning, Tusk is grimacing.

The moment, heavy on symbolism, is a victory for May, who stepped into the vacuum left last summer when her predecessor, David Cameron, abruptly resigned after the public disregarded his call for the country to stay in the European Union.

Although May was herself quietly in favor of ‘remain’ during the campaign, she pivoted quickly in the aftermath of the vote and adamantly maintained that she would make good on the public will. “Brexit means Brexit,” she repeatedly declared.

It was not until January, however, that May gave true shape to what Brexit might mean. In a speech at London’s Lancaster House — the opulent, parkside mansion that doubles as Buckingham Palace in the Netflix drama The Crown — May made the case for a clean break from the European Union.

The country, she said, would not try to remain a full member of either Europe’s common market or its customs union. Instead, she said, the country would prioritize regaining control over immigration and taking itself out of the jurisdiction of the European Court of Justice.

“We seek a new and equal partnership — between an independent, self-governing, global Britain and our friends and allies in the EU Not partial membership of the E.U., associate membership of the E.U., or anything that leaves us half-in, half-out,” she said.

As Britain prepares to leave, it remains deeply divided. Opinion polls show that the country is split almost evenly today as it was last June.

In a statement released late Tuesday night — just hours before the formal declaration — May called for Britain to “come together.”

She also vowed that in the negotiations to come, she will seek to represent the interests of “every person in the whole United Kingdom — young and old, rich and poor, city, town, country and all the villages and hamlets in between.”

But that could be an impossible task.

Of the four nations that make up the United Kingdom, only two — England and Wales — voted for Brexit. The other two, Scotland and Northern Ireland, came down against it.

Scotland’s semiautonomous parliament voted Tuesday to seek another independence referendum. Advocates argue that an EU departure against the will of Scottish voters has sufficiently changed the calculus since the last independence vote, in 2014, that a new one is justified.

Irish nationalists in Northern Ireland have also used Brexit to renew their decades-long efforts to break away from Britain.

Even the top ranks of May’s own government have been divided over how hard a break they should seek from Brussels after decades of grudging British involvement in European integration.

The country’s top financial official, Chancellor of the Exchequer Phillip Hammond, is believed to favor a much softer exit than the hard-line favored by others in May’s cabinet, including Foreign Secretary Boris Johnson.

In an interview with the BBC Wednesday morning, Hammond appeared to be tweaking Johnson by saying that in negotiations with Europe, “we can’t have our cake and eat it.”

Johnson has often said that he is “pro-cake and pro-eating it” when it comes to Britain’s EU relations. The comment has become a byword for European frustrations with Britain, which is seen by many continental officials as wanting to enjoy the benefits of the E.U.’s continued existence without bearing the burden of responsibilities.

Europe has taken an unusually united stand in asserting that Britain won’t be able to secure a better deal than the one it has today. If it does, German Chancellor Angela Merkel and other stalwart defenders of the EU fear that Britain could be just the start of a broader unraveling.

In France, for instance, polls show that anti-E. U. firebrand Marine Le Pen is almost certain to reach the second round of this spring’s presidential contest — and is within striking distance of winning.

Because of the distraction of that vote and of German elections in the fall, Britain’s EU divorce talks are likely to get off to a slow start. The 27 nations that are being left behind, for instance, are not expected to even formalize their negotiating stance until a summit in late April.

Once the talks begin in earnest, there will be little time to finish. The negotiations are capped at two years, meaning they must be complete by March 2019.

But officials have said the fall of 2018 is the real deadline because any new arrangement between Britain and its erstwhile partners will need to receive approval from every national legislature, a politically delicate and time-consuming process.

If Britain and the EU can’t come to terms on a new trade deal before the deadline, the two sides would revert to World Trade Organization rules for exchanges across the English Channel. In practice that means significantly higher tariffs, and likely economic harm to both sides.

Despite the risks, Britain’s impending exit was celebrated Wednesday by the country’s rabidly pro-Brexit tabloids.

“Freedom!” exulted the front page of the Daily Mail.

The mood was more sober across the English Channel, with EU budget commissioner Günther Oettinger calling Wednesday’s Article 50 letter “a negative message for Europe as a whole, and for the U.K. especially.”