BUCHAREST (Reuters) - Provincial mayor Klaus Iohannis defied expectations to win Romania's presidential election on Sunday, inflicting a shock defeat on Prime Minister Victor Ponta that was cheered by thousands of anti-government protesters on the streets.
An ethnic German whose campaign was backed by two centre-right parties, Iohannis turned round a 10-point deficit to win the runoff, as widespread anger at voting problems overseas appeared to galvanize the anti-Ponta camp.
Analysts had said that victory for Ponta might have helped make Romania a more stable nation, with the main levers of power held by one bloc. By contrast, Iohannis's win could trigger renewed political tensions in one of Europe's poorest states.
Backed by a well-oiled party machine, Ponta had led opinion polls throughout the campaign and comfortably beat Iohannis in the first round election on Nov. 2.
But Ponta abruptly conceded defeat after the exit polls were released. Later the first official results showed Iohannis on 55.8 percent against 44.2 percent for Ponta, with a third of polling stations counted. Turnout was at its highest since 1996.
"Dear Romanians, you were phenomenal today. We've seen a massive turnout, and my respect for the diaspora," Iohannis said before joining the crowds in downtown Bucharest.
Despite the loss, Ponta ruled out quitting as prime minister and said his Social Democrat alliance would remain in power until parliamentary elections due in 2016.
Thousands of people took to the streets of Bucharest and other cities to voice their anger at Ponta's government on Sunday night and demand his resignation.
The former Communist state of 20 million is emerging from painful budget cuts imposed during the global slowdown. Growth rebounded to more than 3 percent in the third quarter of 2014, but corruption and tax evasion are rife, and progress to implement reforms and overhaul a bloated state sector is mixed.
Prime minister since 2012, the 42-year-old Ponta often feuded with his rival, outgoing President Traian Basescu, which stymied policymaking and caused a constitutional crisis.
Without the check on power hitherto provided by Basescu, Ponta's rise had raised concerns he might tighten political control over the judiciary, prosecutors and media, in a country whose justice system remains under special EU supervision.
But Iohannis as president will, like Basescu, face a hostile parliamentary majority that could cause more policy wrangling.
The 55-year-old Iohannis had promised during the campaign to safeguard the independence of Romania's judicial system and the fragile progress made in tackling corruption. He also pledged economic, health and education reforms, and to create an attractive business climate for foreign investors.
Overseas voters played a key role in swinging the vote at the last presidential election in 2009. Romania's large and growing diaspora is widely seen as anti-Ponta, and many voiced their anger when long queues and bureaucratic hurdles prevented them from voting in the first round.
The uproar triggered the foreign minister's resignation and sparked protests in cities across Romania.
"I hope I voted for a more normal Romania, compared with the present one, which has a plagiarizing prime minister, all sorts of political barons and lies," said Oana Neneciu, 30, who works for an environmental NGO and attended a rally on Sunday night.
Ponta has denied allegations that he plagiarized large parts of his doctoral thesis.
TV footage showed long queues outside diaspora voting stations in cities across Europe on Sunday. Waiting since the early hours, Romanians in Munich flashed toothbrushes to the cameras to show how long they were prepared to wait to vote.
The office of president was created under Communist dictator Nicolae Ceausescu in 1974 and is a powerful position, with the holder able to appoint the prime minister, judges and prosecutors -- and also stall government policy proposals.
"Victor Ponta has made a few major strategic mistakes," said Sergiu Miscoiu, an analyst with the CESPRI political think tank.
"A major mistake was ostracizing the diaspora."
Iohannis is a former high-school physics teacher praised for his managerial skills in running the Transylvanian town of Sibiu. A descendent of Saxons who settled in Romania in medieval times, Iohannis will become the country's first president from an ethnic minority.
Writing by Matthias Williams; additional reporting by Radu Sigheti; Editing by Mark Potter, Giles Elgood and Crispian Balmer