For Labour, which suffered its worst election defeat since 1935, the results signaled the end of an era of being able to reach into both thriving cities and left-behind former mining villages for votes. The party’s two wings — pro- and anti-immigrant, young and old, university graduates and tradespeople — were cleaved.

“It’s the detachment of the Labour Party from great swaths of the country, which they seem not to sympathize with,” said Robert Tombs, a historian at the University of Cambridge. “That leaves the party in a pretty dire position in the long term, unless it can miraculously reinvent itself.”

The big, longstanding parties of the left started vanishing from Europe years ago as class alliances faded in a postindustrial economy. But the consequences of the political realignment in Britain, as in the United States, are much graver because their two-party systems prevent left-wing parties from simply resolving their differences by splitting.

The left is now squabbling on both sides of the Atlantic, with both the Labour and Democratic parties grappling with a rancorous battle between young activists and more moderate voters. The results yesterday in Britain were a sobering lesson in the consequences of destroying age-old party alliances before new ones had time to germinate, analysts said.

“You’ll have the pro-migration, culturally liberal left saying, ‘We don’t want to ally with racists,’ and you’ll have the socially conservative, economically left-wing part of the coalition saying, ‘We don’t ally with people who think we’re racists,’ and that’s a very, very hard argument to resolve,” said Rob Ford, a professor of politics at the University of Manchester.

By Friday morning, Britons awoke to a Labour Party largely consigned to the cities of England. The Conservatives, on the other hand, harnessed the power of Brexit to storm districts where the party’s brand had been toxic for generations.

In doing so, they replicated the success of President Trump in breaching the so-called Blue Wall in states like Michigan and Wisconsin in 2016, exploiting a combination of anti-immigrant messaging and dissolving class allegiances to take seats thought to belong to the Democrats.