LONDON — British Prime Minister David Cameron’s Conservative Party unexpectedly surged ahead of Ed Miliband’s Labor Party in national elections Thursday, according to exit polls, suggesting that Cameron will have the votes needed to form a government and remain in power.

The Conservatives may have captured 316 seats in Parliament to Labor’s 239, exit polls indicated late Thursday, though official results were not yet available. Nick Clegg’s Liberal Democrats apparently took just 10 seats, which would be a precipitous drop from the 57 seats that brought it into a coalition with the Conservatives at the last election.

But opposition leaders quickly threw cold water on the exit polls, which came shortly after voting ended at 10 p.m. and before official results had been tallied.

And Labor deputy leader Harriet Harman said that even if the numbers turned out to be correct, “the question is, of the (members of Parliament) that have been elected tonight, does the coalition still have a majority?”

The Conservatives, however, were offering some cautious optimism about their apparent victory.

“I believe it could be right, yes, and if it is right, then it means the Conservatives have clearly won this election and Labor have clearly lost it,” said Michael Gove, the Conservative Party chief whip. “It would be an unprecedented vote of confidence in David Cameron’s leadership.”

A near-certain winner was Nicola Sturgeon’s Scottish National Party, which exit polls indicated will take 58 of a possible 59 seats, up from six in 2010. Even if the exit polls prove to be generous, it is a striking comeback, with the party taking nearly all of Labor’s 41 seats in the northern region.

Its victories also set up the possibility that nearly 60 members of Parliament will be with a party of Scottish separatism, operating in a government fiercely opposed to those ambitions.

Leading up to election day, neither the Conservative Party nor the Labor Party was forecast to garner much more than one-third of the 650 seats in Parliament, meaning leaders would need to form a coalition to run the country. The election was considered among the most important in decades, with issues that include austerity policies, health care funding, as well as matters such as Britain’s relationship with the United States and the European Union.

A decisive Tory victory would be a remarkable turnaround for the prime minister, who many thought would be facing a messy postelection period, seeking to remain in power despite few available coalition partners. It could also spell doom for Miliband, who struggled to connect with voters.

During the campaign, Cameron said Labor would be held hostage by the SNP in a coalition scenario, and Miliband took Cameron to task over his plan for a referendum on Britain’s EU membership.

Economic concerns also figured into the campaign.

Miliband positioned himself as a candidate of the middle and working classes, despite charges that the SNP had abandoned its blue-collar roots.

Cameron, however, had said that relatively low unemployment meant his leadership had served working people, an argument that worked for Sheila Burns, who voted Conservative.

“I think perhaps (Cameron) needs another five years to sort us out,” said Burns, a retiree.