IN A world where politics often seem locked down by political scientists and campaign consultants, it is nice to be surprised once in a while. Opinion polls leading up to Romania's presidential elections on Sunday all predicted a clear victory for Victor Ponta, the Socialist prime minister, whose massive billboards and broadcast-media appearances had dominated the campaign. The polls were wrong. Romanians voted solidly for Klaus Iohannis (pictured), the no-nonsense mayor of Sibiu, a town in Transylvania. Early results on Monday showed Mr Iohannis, an ethnic German who belongs to a Lutheran church, scooping up 54.5% of the vote. At a post-election victory party, supporters greeted him with cries of "Dankeschön". He will become the first member of an ethnic minority, and the first non-Orthodox Christian, to serve as president in Romania's post-communist history.

What the polls failed to predict was a massive bump in turnout. Participation was over 64%, far higher than in the first round of the elections two weeks earlier, which had narrowed the contest to a run-off between Mr Ponta and Mr Iohannis. In a press conference in Bucharest on Monday, a triumphant Mr Iohannis called the turnout “the best surprise of the elections”. The 55-year old former physics teacher took particular care to thank Romanians abroad for voting, or trying to: just as in the election's first round, many in Romania's large foreign diaspora queued for hours at polling stations in embassies and consulates, only to be turned away.

“Someone has to bear the consequences of this catastrophic vote organised abroad," Mr Iohannis said. In Italy and France, angry would-be voters clashed with local police, who used tear gas to disperse them. Mr Iohannis urged the outgoing president, Traian Băsescu, to recall Romania's ambassadors to those countries. Perversely, though, the voting problems outside Romania seemed to have mobilised higher turnout at home. Solidarity protests with voters abroad were held throughout the week before the election, culminating in demonstrations Sunday night in the cities of Bucharest, Cluj and Sibiu. Those demonstrations turned into street parties for Mr Iohannis when Mr Ponta conceded his defeat, two hours after polls closed. Twitter and Facebook threads bearing election-related hashtags beside images of voters abroad clashing with police helped drive people in Romania to the polls.

Voting reform will be high on Mr Iohannis's presidential agenda. He urged the government to introduce legislation to set up systems for voting electronically or by mail, rather than at polling stations at embassies. Currently, voters must cast their votes on printed paper ballots, which are then marked with an official stamp. Polling stations in London, Paris, Brussels and Rome had between three and seven stamps with which to mark the ballots of tens of thousands of people, restricting the speed of the voting.

Mr Iohannis has vowed to chart a strong Euro-Atlantic course for his country. On Monday he emphasised Romania's strategic partnership with America, and its roles in NATO and the European Union. Although Romania's prime minister enjoys broad executive powers, the president has the final say on foreign and security matters. As for Mr Ponta, he said he sees no reason to step down as prime minister, but would do so “in one to two years” if he loses his majority in parliament. But after his unexpected and decisive loss on Sunday, he will face increasing pressure, both from the opposition and from his own party, to resign.