British Prime Minister Theresa May will ask the queen Friday to form a government despite her Conservative Party losing majority in Parliament.

May’s gamble to call an early election appeared to have backfired and now she will have to seek the support of another party or group of parties to command a majority in the House of Commons. May has no intention of resigning as prime minister, despite calls from Labour leader Jeremy Corbyn to do so, according to Sky News.

The Conservatives held 330 seats in Parliament heading into Thursday’s general election. But by early Friday, the party only garnered 318 seats. The party would have needed 326 seats to hold a majority.

The Labour Party gained 29 seats in the general election, totaling 261.

The Conservatives remain in position to form a coalition government with the help of several Unionist Members of Parliament for North Ireland. However, if coalition negotiations fail, the outcome raises the possibility of the two major parties attempting to form minority governments – an outcome that could lead to a second general-election in the months ahead.

“This country needs a period of stability,” May told supporters after she was re-elected to her own seat in the House of Commons on Thursday. “If the Conservative Party has won the most seats, it will be incumbent on us to deliver this period of stability.”

Earlier Thursday, Corbyn had called on May to step down, saying that her attempt to seek a big mandate for her government to negotiate the U.K.’s departure from the European Union had ended in “lost Conservative seats, lost votes, lost support and lost confidence.

"I would have thought that’s enough to go, actually and make way for a government that will be truly representative of all of the people of this country,” he added.

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.

"This is completely catastrophic for the Conservatives and for Theresa May," former Conservative Treasury chief George Osborne told ITV. "Clearly if she's got a worse result than two years ago and is almost unable to form a government, then she, I doubt, will survive in the long term as Conservative Party leader."

The forecast was a victory in all but name for Labour, which had been expected to lose seats.

Labour deputy leader Tom Watson, who easily won re-election in his seat, made a savage attack on May in a speech to his supporters.

“She said she was strong and stable, the public saw that she was weak and wobbly,” said Watson, playing off the prime minister's campaign slogan. “She said she was a bloody difficult woman ... the public saw she was just a woman finding it all a bit too bloody difficult.”

“The next few days look very uncertain but one thing is sure,” Watson said. “Theresa May's authority has been undermined in this election."

The result was also bad news for the Scottish National Party, which by early Friday had lost 21 of its 54 seats. Among the casualties was Alex Salmond, a former first minister of Scotland and one of the party's highest-profile lawmakers.

A big loss could complicate the SNP's plans to push for a new referendum on Scottish independence as Britain prepares to leave the EU.

"Indy Ref 2 is dead in Scotland," said Scottish Conservative leader Ruth Davidson, using a short form for a second independence referendum.

U.K. Independence Party leader Paul Nuttall announced his decision to resign Friday. UKIP made no dents in the election, losing one seat.

May called the election seven weeks ago, when her party was well ahead in the polls.

But things didn't go to plan.

Brexit failed to emerge as a major issue in the campaign, as both the Conservatives and Labour said they would respect voters' wishes and go through with the divorce.

Then, attacks that killed 30 people in Manchester and London twice brought the campaign to a halt, 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 a concert in Manchester. Before the election, five people died during a vehicle and knife attack near Parliament on March 22.

Rachel Sheard, who cast her vote near the site of the London Bridge attack, said the election hadn't gone as expected — and that it certainly wasn't about Brexit.

"I don't think that's in the hearts and minds of Londoners at the minute, (not) nearly as much as security is," said Sheard, 22. "It was very scary on Saturday."

While security was on many voters' minds, it was far from the only issue.

"It's important, but it's only one issue amongst several," said 68-year-old Mike Peacroft. "I wouldn't necessarily say it's at the top. Obviously at my end of the (age) spectrum I'm more interested in things like pensions and so forth, NHS health care — plus schooling, those are really my main concerns."

Fox News' Samuel Chamberlain and the Associated Press contributed to this report.