Prime Minister Victor Ponta conceded shock defeat in Romania's presidential race on Sunday after exit polls showed centre-right candidate Klaus Iohannis had staged a surprising comeback against the frontrunner.
Backed by a well-oiled party machine, Ponta had led opinion polls throughout the campaign and comfortably beat Iohannis, an ethnic German, in the first round election on Nov. 2.
Although the first official results were not due until 0000 GMT, Ponta phoned Iohannis to congratulate his opponent well before then. But despite the loss, he ruled out quitting as prime minister and said his Social Democrat alliance would remain in power until parliamentary elections due in 2016.
"I have no reason to resign," he told a local TV station.
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.
Thousands of people took to the streets of Bucharest 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.
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, sparked protests in cities across Romania and may have helped galvanize the anti-Ponta vote.
"I hope I voted for a more normal Romania, compared with the present one, which has a plagiarising prime minister, all sorts of political barons and lies," said Oana Neneciu, 30, who works for an environmental NGO and attended Sunday night's rally.
Ponta has denied allegations that he plagiarised large parts of doctoral thesis.
"What happened with the diaspora was a major problem. It helped build up momentum," said Neneciu.
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 ostracising the diaspora."
Iohannis is a former high-school physics teacher credited with transforming the medieval Transylvanian town of Sibiu into a tourist hub during his time as mayor.
One of his two main backers, the centre-right Democratic Liberal Party, was toppled by anti-austerity protests that paved the way for Ponta to become premier.