The headframe of a shaft mine looms at the National Coal Mining Museum for England, near the northern city of Wakefield, in March 2015. Wakefield, a safe Labour seat since 1932, could swing to the Conservative Party in elections Thursday, according to polls. (OLI SCARFF/AFP/Getty Images)

This northern English city that was built on the fortunes of now-shuttered coal mines has voted for the Labour Party since 1932. But ahead of elections set for Thursday, British Prime Minister Theresa May sees an opening here that she hopes could help shut out her political opponents for a generation.

May’s Conservative Party is gunning for seats across regions where it has been in the minority for almost a century, calculating that Britain’s decision to leave the European Union will help it capture pro-Brexit working-class voters long loyal to the leftist labor unions. Wakefield, a city so defined by coal that even its furniture used to be made of the stuff, is one place the party just might pull it off, according to opinion polls.

The effort holds echoes of President Trump’s successful foray into the U.S. Rust Belt, where factory workers, miners and others hurt by globalization spurned Democrats in favor of a candidate who promised to rebuild their world. 

May is a cautious candidate, not a throw-away-the-rules leader such as Trump. But if she does manage to turn working-class regions Conservative — and then consolidate and build upon those victories — she could lock her party into power for years. In a race upended twice in two weeks by terrorist attacks, the outcome is far from clear, and Jeremy Corbyn’s Labour Party was gaining in polls before the attack in London on Saturday that claimed seven lives. But the fact that May saw opportunities in Labour’s northern stronghold suggests the degree to which Britain’s center-left is vulnerable. 

British Prime Minister Theresa May walks out to take part in a televised event between the Conservative and Labour leaders in London on May 29. (Stefan Rousseau/AFP/Getty Images)

“I know this city is one of the places that people call a traditional Labour area,” May said at a rally in Leeds, a major Labour-voting city near Wakefield, shortly after she called the snap election in April. But, she added: “This election is not about who you may have voted for in the past. It is about voting in the national interest.”

At the National Coal Mining Museum for England, on the site of a closed coal mine just outside Wakefield, former coal miners testify to the transformation. Most of them still voice loathing for Prime Minister Margaret Thatcher, the Conservative leader who smashed the power of coal miners’ unions in the 1980s and whom many here still blame for the mines’ eventual closure.

But 30 years later, it is Corbyn rather than May who draws criticism.

Chris Brown, 67, who started working in a mine when he was 15 and wears a coal-smudged jumpsuit to take tourists deep into the old shaft, said he had never voted for any party but Labour. But he said he dislikes Corbyn.

“I don’t trust him,” he said. “Anybody can’t be a pacifist with what’s going off. We need our own defenses.”

The Conservative candidate in Wakefield says he is happy to seize the opportunity.

“We have people who are voting for Conservatives for the first time in their lives,” said Antony Calvert, who has been running his insurgent campaign out of a former secondhand shop in the center of this city of 78,000. Many of Wakefield’s buildings stand vacant, even on the main shopping street, their faded signs testimony to an era when mines and factories guaranteed good, lifelong jobs to anyone who wanted one.

Britain's main opposition Labour Party leader Jeremy Corbyn speaks at a general election campaign event Tuesday in Birmingham. (Paul Ellis/AFP/Getty Images)

Calvert, 39, a locally born property consultant, lost his last bid for election, in 2015, by 2,600 votes — a tellingly narrow margin for a district that last elected a Conservative in 1931. 

Last year, Wakefield voted 66 percent in favor of Brexit, well ahead of the national tally of 52 percent, and Calvert thinks he can complete his coup against a Labour candidate who is passionately committed to Britain remaining in the European Union. Calvert also expects to receive a bounce from supporters of the pro-Brexit U.K. Independence Party, which captured 18 percent of the vote two years ago but this time is backing him instead of fielding its own candidate.

“The Conservative Party spent years and years organizing about how to detoxify ourselves in a place like Wakefield,” Calvert said. But social changes over time may have done the job for it.

“Margaret Thatcher came into power when I was 1 year old,” he said. “People who were working in the mines are getting a bit older. They see things a bit differently. They don’t like mass immigration. They don’t like the culture they’ve seen all their lives changing.”

Local Labour leaders acknowledge the challenge, although they argue that they can win this week on the strength of an election platform that they say offers stronger health care, education and social benefits for working people.

Corbyn, a longtime London backbencher who seized control of the Labour Party with an upset win in 2015, holds little appeal in places such as Wakefield, where voters see his past sympathy for the separatist Irish Republican Army and his desire to do away with the country’s nuclear weapons as out of step with their wish for a strong Britain. 

Still, Corbyn’s affability during high-profile televised debates and interviews may have helped him with voters unimpressed by May’s stiffer style. Labour has come back from a nationwide 20-point deficit in late April to within five or six percentage points in some recent polls, largely based on younger voters who do not always show up to cast a ballot.

And in Wakefield, where opinion polls initially suggested the Conservative candidate would be a shoo-in for the seat, Labour has caught up in the past week. That has left the race a toss-up, according to Electoral Calculus, a polling tracker.

Even a toss-up represents a remarkable shift.

“When I was first elected, I think I got 97 percent of the vote,” said Peter Box, the head of Wakefield’s local council and a Labour member of the body since 1983. “It was a bit like Russia, a huge Labour area. Now that’s shifted, because mining has disappeared. Union affiliation has changed.”

Even as Labour has had a lock on Wakefield for 85 years, its power has been declining in lockstep with mine closures and the weakening of the labor unions.

“It’s like the Tories are kicking down the door of a house that has been rotting for some time. It needs one big shove, and it will fall over,” said Robert Ford, a political analyst at the University of Manchester.

Like Trump, who has abandoned some Republican orthodoxies — such as free trade — in the name of protecting U.S. workers, May also has steered Conservatives toward policies that are more interventionist, Ford said.

“There are areas of the country that were turned off by the free-market approach that are finding something to like about the Tory party now,” he said. 

One person who plans to vote Conservative in Wakefield said she never could have imagined turning against a party that her family has supported as far back as she can remember. But the Brexit vote was the final jolt in a transformation wrought by long-simmering frustration.

It used to be that “the Labour Party was run by good working people. I always used to feel that, like, they had your back. It’s not like that anymore,” said Gillian Cruise, 49, a caregiver who has been knocking on doors for Calvert.

“I never thought I’d see the day when I said the Conservative Party is what the Labour Party used to be,” she said. “They make me feel safe.”

Karla Adam in London contributed to this report.