To the recorded peals of Big Ben and the gentle fluttering of Union Jacks, Britain bade farewell to the European Union at 11pm Friday, severing ties to the world’s largest trading bloc after nearly half a century and embarking on an uncertain future as a midsize economy off the coast of Europe.

For Britain, having transitioned in the postwar era from a globe-girdling empire to a reluctant member of the European project, it was yet another epoch-making departure.

It is a departure that will upend settled relations in virtually all areas of society, the economy and security matters, while confronting Britain with new questions of national identity. Three and a half years after Theresa May, then the prime minister, proclaimed that “Brexit means Brexit,” the British government will finally have to decide precisely what that means.

Britain must still negotiate its future trade relations with the European Union, a thorny process that could take through the end of the year, or longer.

On Friday, the departure elicited both hope and trepidation from Britons. Many simply were relieved that the bitter and divisive debate over Brexit is over.

“This is the moment when the dawn breaks, and the curtain goes up on a new act in our great national drama,” said Prime Minister Boris Johnson, in an address to the nation Friday night that he also posted on his Twitter account. Brexit, he said, was a chance to “spread hope and opportunity to every part of the UK.”

Johnson, whose vow to “Get Brexit Done” won him a commanding majority in elections last month, vowed to knit together a country that had been split geographically and generationally by the Brexit debate. Even the future of the United Kingdom now seemed uncertain, with Scotland threatening to renew its drive for independence and Northern Ireland musing about unification with Ireland.

On Friday, Johnson’s Cabinet met in Sunderland, an industrial city in the north, a traditional Labour stronghold where the early returns after the referendum in June 2016 foretold the country’s stunning decision to leave the European Union. The prime minister celebrated Brexit as a triumph for self-government, and promised to undertake the “biggest revival of our infrastructure since the Victorians.”

For all the historical resonance, the celebrations of Britain’s departure were oddly attenuated. A countdown clock flickered on the darkened wall of 10 Downing St., while inside the prime minister hosted a party with British-sourced food and English sparkling wine.

British embassies were instructed to hold low-key affairs — no special events — and to avoid anything that smacked of “triumphalism.”

In a chilly Parliament Square, several thousand Brexiteers gathered to sing “God Save the Queen” as the clock struck 11 p.m. Even the timing of the exit seemed a compromise: the European Union decided to make Britain’s departure effective at midnight in its Brussels headquarters.

Some British commentators complained that the Europeans made a greater show of Britain’s leaving, which they had opposed, than Britain did. Brussels staged a light show in the Grand Place on Thursday, while members of the European Parliament serenaded their departing British colleagues with “Auld Lang Syne.”

The ambivalence attested to the divisions that still run through Britain. Pro-Europe activists were despairing, some channelling their anger into efforts to help Europeans in London navigate the reality of reduced rights and a more tenuous life in a country they had long made their home.

Still, even the most vociferous opponents of Brexit seemed eager to end, or at least suspend, the toxic debate, make the best of the outcome and try to forge a new relationship with the European Union more to their liking.

“Britain can alter its political relationship with Europe, but it can’t alter its historical or geographical relationship and, in the end, we’ll have to find a way of working together,” Tony Blair, a former prime minister and ardent opponent of Brexit, said Friday to foreign journalists in London.

“It’s a destiny-changing decision and obviously it’s one I’m profoundly sad about,” said Blair, who had his own struggles with Britain’s fitful relationship with Europe. “But you’ve got to take a big historical look at this.”

As Britain casts off from Europe, Johnson hopes to deepen his country’s alliance with the United States, starting with a trade deal that the government wants to negotiate in tandem with its agreement with the European Union. President Donald Trump avidly encouraged Brexit, and his emissary welcomed Britain’s new status.

“America shares your optimism and excitement about the many opportunities the future will bring,” Robert Wood Johnson IV, the US ambassador to Britain, said in a statement.

Yet, doubts remained about what sort of a trade deal Britain could expect from Trump.