Updated

British Prime Minister Theresa May was battling to hold on to a narrowing lead as U.K. voters weighed terror, Brexit and immigration in an election that once seemed like a landslide for the incumbent.

Late polls show a tightening race between May and her lead opponent, Labor Party leader Jeremy Corbyn, in a general election that will determine how the U.K. negotiates its exit from the European Union and how it handles attacks from radical Muslims, among other things. But surveys showed May carrying a lead of as much as 8 points, and had her on pace to keep a 50-seat majority in Parliament.

The 60-year-old May, who took over as prime minister last year after David Cameron stepped down following the Brexit referendum result, had what many saw as an insurmountable lead over her political rivals, a lead that could actually widen her current majority in the House of Commons.

Then came the Manchester bombing on May 22 and  the London Bridge van and stabbing attacks on June 3. The Manchester attack left at least 22 dead and some 119 injured, while at least 8 were killed and more than 50 injured in the assault at London Bridge.

Corbyn quickly jumped on the opportunity to remind voters of what May did when she was Cameron’s home secretary, or top law officer: She oversaw cuts to the police department of some 20,000 local officers. Suddenly the 68-year-old socialist appeared within striking distance of No. 10 Downing St.

One recent poll shows May with a relatively small 6 percent lead over Corbyn -- though British political observers warn the polls are often wrong about outcomes.

"The opinion polls are tightening but the opinion polls in Britain are a bit unreliable," said Mark Garnett, a politics professor at Lancaster University.

"How people intend to vote is very different from how they will actually vote," Garnett told Fox News Wednesday. "Corbyn immediately went on the offensive and said this is largely due to the fact that police numbers have been curbed. May was home secretary in charge of the police before she became prime minister. The whole narrative [of the campaign] has suddenly become cuts to the police."

Corbyn, widely written off at the start of the campaign, has drawn thousands of people to upbeat rallies and energized young voters with his plans to boost public spending after years of Conservative austerity.

"They underestimated us, didn't they?" Corbyn told supporters in Glasgow on Wednesday. "They underestimated the good sense of ordinary people, ordinary people all over Britain."

An election that had appeared to be a referendum on May’s ability to negotiate a good Brexit deal had become a referendum on her ability to keep Britons safe. She may yet win, but prospects of her building or even retaining her majority in Parliament have dimmed dramatically.

"People have been questioning whether Theresa May symbolizes stable and strong leadership," said Michael Geary, professor of European studies at Maastricht University in the Netherlands.

"Jeremy Corbyn over the last few days has been rising in a kind of Bernie Sanders way amongst the young and those on the left," Geary told Fox News.

The Associated Press contributed to this report.