Former PM Milos Zeman has won the Czech Republic's presidential election - the first time the position has been decided by direct popular vote.
He won 55% of votes in the second-round poll, compared to Foreign Minister Karel Schwarzenberg's 45%.
Voters had braved freezing conditions to turn out in what was being seen as a nail-bitingly close poll.
Mr Zeman is seen as a hard-drinking, chain-smoking politician, known for his witty put-downs of opponents.
As president, he will represent the Czech Republic abroad and appoint candidates to the constitutional court and the central bank, but the post does not carry much day-to-day power.
Mr Zeman will replace the eurosceptic Vaclav Klaus, who steps down in March after ten years in office.
Both presidential candidates support deeper integration of the European Union.
The result is a triumphant return for a man many thought was finished in politics.
Ten years ago Mr Zeman was humiliated in his first attempt to become president, says the BBC's Rob Cameron in Prague - even members of his own party didn't vote for him.
He has spent much of the last decade in retirement at his country cottage, but he returns now to political life with a vengeance.
He seems to have won the support of many poorer, older voters from areas of the country that have suffered in the economic downtown.
Mr Zeman won 24.2% in the first round poll, with Mr Schwarzenberg winning 23.4%.
Although Czechs are generally disillusioned with politics, they turned out in their droves to choose between the two very different candidates - Mr Zeman, the acerbic former Social Democrat prime minister, and Karel Schwarzenberg, the elderly, aristocratic foreign minister.
The urban elite voted en masse for Mr Schwarzenberg - who was supported by many in the media and had a strong Facebook following, says our correspondent.
A titled prince, 75 years old but wildly popularly amongst young, urban voters, in the early 1990s, he worked as chancellor to the President Vaclav Havel, the leader of the Velvet Revolution that brought down Communist rule in 1989.
For Mr Schwarzenberg's supporters, this is a bitter defeat.