Slovenians on Sunday elected Natasa Pirc Musar, a lawyer linked to former US first lady Melania Trump, as the country's first woman president.
Pirc Musar, backed by the centre-left government, beat ex-foreign minister Anze Logar, a veteran of conservative politics, in a presidential run-off in the EU country of two million people.
Pirc Musar, who headed the country's data protection authority for a decade, won almost 54 per cent of the vote, ahead of Logar who got just over 46 per cent, according to the election commission.
"Slovenia has elected a president who believes in the European Union, in the democratic values on which the EU was founded," she told reporters, adding she would "give all my efforts so that politicians unify on strategic issues".
The human rights advocate has vowed to be "the voice of women" in Slovenia and abroad and a "moral authority" in her new role, which is largely ceremonial.
"The president cannot be neutral... and have no opinion... I have never been afraid to speak out," the former television presenter, 54, told AFP ahead of Sunday's vote.
As a lawyer, Pirc Musar was hired to protect the interests of Slovenian-born Trump during her husband's presidency, stopping companies attempting to commercialise products with her name.
During the campaign, Pirc Musar, who is a keen motorcyclist, came under attack because of her husband's lucrative investments -- especially in tax havens.
Fresh setback for conservatives
The results mark a fresh setback for the country's conservatives.
Logar, 46, ran as an independent but is a long-time member of the Slovenian Democratic Party (SDS) of Janez Jansa, who failed in his bid to be re-elected as premier in April.
Critics accused Jansa of attacking media freedom and the judiciary and undermining the rule of law in his latest term in office.
"This election confirmed once again the vote against Janez Jansa. Logar is not the biggest loser tonight but it is Jansa," Vlado Miheljak, a professor at Ljubljana University, told AFP.
Rok Novak, an economist in his early 50s, said at a Ljubljana polling station that he hoped a candidate that "will bring people together" would win.
"Slovenia is so polarised right now."
Logar congratulated Pirc Musar.
"I expect she will be the president of all of us, that is what Slovenia needs," he told reporters.
Logar came out ahead in the first round last month when the centre-left votes were split largely between Pirc Musar and another candidate.
Incumbent Borut Pahor, a former Social Democrat, could not run for re-election after having held the post for two five-year stints.
Pirc Musar will take over the post by the end of next month.
Pensioner Silva Lotric was optimistic as she cast her ballot.
"If my candidate wins, she will definitely bring changes," she said.