In the final stretch ahead of this Thursday's voting, the contest now looks to be a cliff-hanger. So far, Mrs May's Conservatives have been ahead in every opinion poll (not that the polls have proved all that authoritative in recent elections). But the Labour opposition has been gaining ground dramatically and there is a real air of suspense about the outcome.
Whatever accounts for the change of national mood, the two grievous terrorist attacks staged during the election campaign appear not to have influenced how people intend to vote.
Two weeks ago, Salman Abedi - England-born, and of Libyan descent - blew himself up in the foyer of a concert venue in the northern city of Manchester. Packed round the explosives in his rucksack were nuts, bolts and other lethal shrapnel intended to cause carnage. 22 people were killed and a larger number seriously injured - many of them teenage girls who had come along to see one of their favourite pop stars, Ariana Grande, perform.
Election campaigning was put on hold for several days. All party leaders roundly denounced the bombing but insisted that the city and the country would come together to express its resilience in the face of such an outrage.
Saturday night's attack in central London again targeted youngsters on a night out. A van crossing London Bridge deliberately mowed down pedestrians. Three men wearing fake suicide belts jumped out, knives in hand, and rushed into some of the trendy bars and restaurants in Borough Market, stabbing anyone within range. The assailants were shot dead by armed police within minutes - but by then, seven people had been killed.
Once again, the main parties paused in their campaigning. But Theresa May has also made remarks which suggest that the issue of how to tackle jihadi violence may shape the final stages of the campaign. "Enough is enough", she declared on Sunday - adding that there was "far too much tolerance of extremism in our country".
Mrs May called the election - after repeatedly insisting that she would not hold early polls - because she said she needed a stronger mandate to conduct the negotiations about the terms on which Britain will leave the European Union. Her current majority in Parliament is distinctly modest.
Theresa May supported remaining in the EU in last year's referendum. But with the shock vote for Brexit, and the resignation of David Cameron as both Prime Minister and Conservative party leader, she won through in the power struggle to replace him.
She's now emerged as champion of what's called a "hard Brexit" involving pulling out not simply of the political and judicial institutions of the European Union but the single market as well.
What most impelled her to hold an early election was the poor standing of Labour's hard left leader, Jeremy Corbyn. Although popular with Labour's rank-and-file, most Labour MPs regard Corbyn as a disaster and, up to just two-or-three weeks ago, he had little obvious public support.
Mrs May's election campaign has been distinctly presidential. It's been all about her and the "strong and stable" government she has promised to deliver. This is the first time she has led an election campaign, and the more the voters see of her, the less they seem to like her.
Rather than strong, she seems strident - rather than stable, she has come across at times as distinctly wobbly. She was forced to do a U-turn mid-campaign over the sensitive issue of how much the old and infirm should pay for their own care. It was, said her political rivals, a "dementia tax." Her public climbdown may have been politically necessary, but it eroded her reputation for resolve.
And her refusal to take part in a televised party leaders' debate gave an impression of lacking confidence.
By contrast, Jeremy Corbyn - a bearded, 68-year-old Londoner - has come across as thoughtful and sincere. His pledges to increase taxes on business and the rich, boost public spending on health, abolish tuition fees for university students, and take key utilities back under state control have proved popular, particularly with the young.
Apart from Scotland, where the pro-independence Scottish National Party remains dominant, the campaign has seen a return to two-party politics. The right-wing nationalists of UKIP have faded now that their key goal, withdrawal from the European Union, is to be achieved. The Liberal Democrats, a pro-Europe centre party, have failed to make much impact.
The consensus among commentators is that Theresa May will win re-election - not least because the elderly, among whom she retains a clear advantage, turn out to vote in greater numbers. But it looks as if her political authority will be diminished. Britain's path in negotiating its route out of the EU may become more entangled.
To put it simply, Mrs May has failed to take on board the lesson which her predecessor, David Cameron, learnt the hard way in last year's Europe referendum: never take Britain's voters for granted.
(Andrew Whitehead, a former BBC India correspondent, is honorary professor in politics at the University of Nottingham.)
Disclaimer: The opinions expressed within this article are the personal opinions of the author. The facts and opinions appearing in the article do not reflect the views of NDTV and NDTV does not assume any responsibility or liability for the same.