LONDON — As British voters prepare to head to the polls on Thursday, an election that was supposed to be a cakewalk for Prime Minister Theresa May and her Tories has turned into a slog across a political minefield.

The prime minister called the surprise snap election in April in hopes of beefing up the Conservative Party’s slender majority in parliament, burnishing her credentials as a strong leader and giving her more leverage ahead of tough negotiations on leaving the European Union. A bonus: An overwhelming win would deal a crushing blow to the reeling Labor Party opposition and its beleaguered leader, Jeremy Corbyn.