In last week’s UK general election, Boris Johnson’s Tories won working-class constituencies held by Labour for a century. They pulled this off by standing for British culture and sovereignty against Brussels — and by vowing to stop unfettered immigration, raise wages and defend pensions and the public-health service.

Does that mix of policies sound familiar? It should.

Trump won in 2016 by tacking right on social issues while going middle of the road or left of center on economics. It was the sweet spot in American politics. For too long before, we had been asked to choose between extreme social liberals on the left and libertarian dogmatists on the right. Trump gave voters what they had been looking for. In Britain and Canada, they call this ideological blend “Red Toryism.”

It goes all the way back to Prime Minister Benjamin Disraeli’s ­invention of the British Conservative Party in the 1840s. His party would be formed of all classes, he said, from the very high to the lowly. It would be the national party, one that took pride in the sceptered isle and sought to make its institutions great.

On economic issues, he broke with free-trade orthodoxy and wrote passionately about economic inequality and the wretchedness of working-class life in East London. He recognized how nationalism has a gravitational force that promotes economic solidarity: You can’t be a nationalist, after all, unless you sense a fraternity with your fellow citizens.

For example, you won’t be satisfied with a health-care system that leaves them at risk or that bankrupts them. President Trump understands this. Intelligent libertarians also understand it — and that’s why they are anti-nationalists.

Like all good Tories, Disraeli had an instinctive mistrust of intellectuals. In a line that could be written by a Trump supporter, he said he had little use for the “oligarchs and philosophers who practice on the sectarian prejudices of a portion of the people.” For “oligarchs,” read today’s moneyed New Class of political donors, technocrats and media people. For “philosophers,” read our radicalized university academics. And for “sectarian prejudices,” read the left’s identity politics and wokeness. They own the culture and think they have the moral standing to dictate what the rest of us are permitted to think, but in 2016 we flipped them the bird.

Political principles didn’t much weigh down Disraeli, and that gave him an entrepreneurial flexibility or even opportunism in appropriating the left’s positions.

As a Conservative prime minister, he extended the franchise to all adult male heads of households in the 1867 Reform Bill. By stealing the issue from the liberals, he ­defanged them. That sort of thing infuriated the liberals — just as today the left is incensed and left impotent when Trump takes pro-worker, pro-family stances on family leave and other issues progressives imagined they owned.

If you are a Red Tory, you don’t see politics as a kind of moral geometry, deriving your policies precisely from a set of fixed principles. Instead, you are comfortable with the real world’s messiness. Some things work, some don’t; you learn from experience and not first principles how to distinguish them.

Finally, all three men — Disraeli, Johnson and Trump — have a natural flair and love of publicity. Politics is grimly serious, as practiced by the left, and we naturally look for a respite from the politician who entertains us.

This Disraeli did, with his colorful clothes, his novels and his wit. That’s also how Johnson climbed to the top of the greasy pole. He might say the damnedest things, but at least he doesn’t bore us like Theresa May — or the dour Jeremy Corbyn. Trump’s entertainment value is also an important ­element in his success. Of course, his tweets can be cringe-making, but the entertainment comes from seeing the left flip out over them.

Libertarian ideologues insist this isn’t conservatism. But history shows otherwise: There is an old and honorable tradition of ­social conservatism that is nationalistic and solidaristic on economic questions. And it’s likely to shape conservatism, and politics across the developed world, for decades to come.

F.H. Buckley teaches at the Scalia Law School. His next book, “American Secession: The Looming Threat of a National Breakup,” is out next month. Twitter: @FBuckley