LONDON (AP) — Spectacularly punished by voters who took away her majority in Parliament, a politically wounded but defiant Theresa May soldiered on Friday as Britain's prime minister, resisting pressure to resign after the failure of a high-stakes election gamble that made the massive challenge of untangling Britain from the European Union only more complex and uncertain.
Having called an early election in hopes of getting an increased majority that could have strengthened her hand in Britain's exit talks with the EU, May instead saw her majority evaporate completely — leaving her fortunes hanging by a thread and dark clouds over the Brexit negotiations just 10 days before they are due to start.
She insisted that she would stick to the Brexit timetable. But she was forced into an alliance with a small party in Northern Ireland just to stay in power. Grim-faced, May said her Conservatives and the Democratic Unionist Party would work together to "provide certainty and lead Britain forward at this critical time."
"This government will guide the country through the crucial Brexit talks ... and deliver on the will of the British people by taking the United Kingdom out of the European Union," she said after seeking Queen Elizabeth II's approval — a formality — for the new, hastily cobbled-together arrangement.
May's snap election call was the second time that a Conservative gamble on the issue of Britain's relations with Europe backfired. Her predecessor, David Cameron, first asked British voters to decide in 2016 whether to leave the EU.
Cameron, gambling that Britons wouldn't want to sever their network of ties with the continent, had promised the Brexit referendum during a 2015 election campaign that gave Conservatives a surprise Parliamentary majority. When voters stunned him and Europe by voting to leave, he resigned, leaving May to deal with the mess.
The latest election shock is "yet another own goal" that will make "already complex negotiations even more complicated," said the European Parliament's top Brexit official, Guy Verhofstadt.
With 649 of 650 seats in the House of Commons declared, May's bruised Conservatives had 318 — short of the 326 they needed for an outright majority and well down from the 330 seats they had before May's roll of the electoral dice.
Rather than resign, May quickly grabbed the lifeline of an undefined alliance with the DUP, which won 10 seats. But even that arrangement seemed shaky. After May went through the largely symbolic process of seeking the queen's approval for the new government, DUP leader Arlene Foster said the two parties were in discussions, but offered no details.
In May's camp, recriminations were immediate and stinging.
"This is a very bad moment for the Conservative Party, and we need to take stock," Conservative lawmaker Anna Soubry said. "Our leader needs to take stock as well."
The biggest winner was Labour leader Jeremy Corbyn. Labour's increase in seats from 229 to 261 — with one seat still undecided — confounded expectations that his left-wing views made him electorally toxic.
In a buoyant mood, Corbyn piled on pressure for May to resign, saying Friday morning that people have had enough of austerity politics and cuts in public spending. He ruled out the potential for deals or pacts with other progressive parties in Parliament.
"The arguments the Conservative Party put forward in this election have lost, and we need to change," he said.
Initially blind-sided by May's snap election call, and written off by many pollsters, Labour surged in the final weeks of the campaign. It drew strong support from young people, who appeared to have turned out to vote in bigger-than-expected numbers, lured by the promise of the elimination of tuition fees, the hope of better jobs and a chance to own property.
"Labour offered something positive," said Queen Mary University political scientist Tim Bale. "There were a lot of goodies in the manifesto."
The fast-moving events both flummoxed and fascinated voters.
"It's a bit of a mess," Peter Morgan, 35, said in London. "I was kind of hoping it would just go the way that the polls suggested it would and we could have a quiet life in Westminster but now it's going to be a bit of a mess."
Many predicted May would soon be gone. Steven Fielding, a professor of politics at the University of Nottingham, called her "a zombie prime minister."
May wasn't the only big loser.
In a blow to its hopes for another referendum on whether Scotland should leave the United Kingdom, the pro-independence Scottish National Party lost about 21 of its 54 seats. Its casualties included Alex Salmond, one of the party's highest-profile lawmakers.
Scottish Conservative leader Ruth Davidson said the idea of a new independence referendum "is dead."
May, who went into the election with a reputation for quiet competence, was criticized for a lackluster campaigning style and for a plan to force elderly people to pay more for their care, a proposal her opponents dubbed the "dementia tax." As the polls suggested a tightening race, pollsters spoke less often of a landslide and raised the possibility that May's majority would be eroded.
Then, attacks in Manchester and London that killed a total of 30 people brought the campaign to a halt — twice. They sent a wave of anxiety through Britain and forced May to defend the government's record on fighting terrorism. Corbyn accused the Conservatives of undermining Britain's security by cutting the number of police on the streets.
Eight people were killed near London Bridge on Saturday when three men drove a van into pedestrians and then stabbed revelers in an area filled with bars and restaurants. Two weeks earlier, a suicide bomber killed 22 people as they were leaving an Ariana Grande concert in Manchester.
But if the election proved one thing, it is that voters in Britain were prepared to be as angry, echoing the undercurrents of elections elsewhere.
"Anyone who thought Britain was a calm relaxed, centrist kind of country will have to think again," Bale said.
Sylvia Hui, Gregory Katz, Sophie Berman, Niko Price and John Leicester contributed to this story.