Britain’s election Thursday was the most unpredictable in years — yet in the end the result was crushingly one-sided. Boris Johnson’s Conservative Party won the largest Tory margin since the days of Margaret Thatcher. Labour, meanwhile, suffered its worst result since the 1930s.

Johnson, who went into the vote at risk of being one of Britain’s shortest-serving prime ministers, is now all-powerful.

The immediate consequence is that, for the first time since the referendum of 2016, it is clear that Britain will leave the European Union. By the end of January it will be out — though Brexit will still be far from “done,” as Johnson promises. But the Tories’ triumph also shows something else: that a profound realignment in British politics has taken place.

Johnson’s victory saw the Conservatives taking territory that Labour had held for nearly a century. The party of the rich buried Labour under the votes of working-class northerners and Midlanders.

After a decade of governments struggling with weak or nonexistent majorities, Britain now has a prime minister with immense personal authority and a free rein in Parliament. Like Thatcher and Tony Blair, who also enjoyed large majorities, Johnson has the chance to set Britain on a new course — but only if his government can also grapple with some truly daunting tasks.

The Conservatives marched into constituencies long seen as Labour strongholds — Blyth Valley, an ex-mining community in the northeast where Tories have for generations been the enemy; Wrexham, Labour turf for more than 80 years; Great Grimsby, a struggling northern port held by Labour since World War II.

The “red wall” of Labour constituencies, which stretched unbroken from north Wales to Yorkshire, was demolished.

Johnson was lucky in his opponent. Jeremy Corbyn, Labour’s leader, was shunned by voters, who doubted his promises on the economy, rejected his embrace of dictators and terrorists and were unconvinced by his claims to reject anti-Semitism.

But the result also vindicates Johnson’s high-risk strategy of targeting working-class Brexit voters. Some of them switched to the Tories, others to the Brexit Party, but the effect was the same: to deprive Labour of its majority in dozens of seats.

Five years ago, under David Cameron, the Conservative Party was a broadly liberal outfit, preaching free markets as it embraced same-sex marriage and environmentalism. Johnson has yanked it to the left on economics, promising public spending and state aid for struggling industries, and to the right on culture, calling for longer prison sentences and complaining that European migrants “treat the UK as though it’s basically part of their own country.”

Some liberal Tories hate the Trumpification of their party (the Conservative vote went down in some wealthy southern seats). But the election showed that they were far outnumbered by blue-collar defections from Labour farther north.

This realignment may well last. The Tories’ new prospectus is calculated to take advantage of a long-term shift in voters’ behavior that predates the Brexit referendum. Over several decades, economic attitudes have been replaced by cultural ones as the main predictor of party affiliation. Even at the last election, in 2017, working-class voters were almost as likely as professional ones to back the Tories. Johnson rode a wave that was already washing over Britain.

Donald Trump has shown how conservative positions on cultural matters can hold together a coalition of rich and poor voters. And Johnson has an extra advantage in that his is unlikely to face strong opposition soon. Labour looks certain to be in the doldrums for a long time. The Liberal Democrats had a dreadful night in which their leader, Jo Swinson, lost her seat.

Yet the Tories’ mighty new coalition is sure to come under strain. With its mix of blue collars and red trousers, the new party is ideologically incoherent. The northern votes are merely on loan. To keep them Johnson will have to give people what they want — which means infrastructure, spending on health and welfare, and a tight immigration policy. By contrast, the Tories’ old supporters in the south believe that leaving the E.U. will unshackle Britain and usher in an era of freewheeling globalism.

Johnson will doubtless try to paper over the differences. However, whereas Trump’s new coalition in America has been helped along by a roaring economy, post-Brexit Britain is likely to stall.

As he negotiates the exit from one union Johnson will face a crisis in another. The Scottish National Party won a landslide this week. After Brexit, which Scots voted strongly against, the case for an independence referendum will be powerful. Yet Johnson says he will not allow one. Likewise in Northern Ireland, neither unionists nor republicans can abide the prime minister’s Brexit plans. All this will add fuel to a fight over whether powers returning from Brussels reside in Westminster or Belfast, Cardiff and Edinburgh.

There is no doubting the strength of Johnson’s position. He has established his personal authority by running a campaign that beat most expectations. But he should remember that the Labour Party’s red wall has only lent him its vote. The political realignment he has pulled off is still far from secure.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.