Finland's conservative former Prime Minister Alexander Stubb has won Sunday's presidential election, final results show.
He secured 51.6% of the vote, while his Green Party rival Pekka Haavisto, the former foreign minister, had 48.4%. Mr Haavisto has already admitted defeat.
It is the first election since Finland joined the Nato military alliance.
Mr Stubb, 55, takes a hardline approach towards Russia, with which the Nordic nation shares a long land border.
He had said that joining Nato was a "done deal" for his country as soon as Russian President Vladimir Putin launched a full-scale invasion of Ukraine in February 2022.
Finland officially became the Washington-led alliance's 31st member last April.
At a press conference late on Sunday, Mr Stubb, a member of Finland's National Coalition Party, described his election victory as "the greatest honour of my life".
He also stressed that it was "rather self-evident that it's difficult to have any kind of political dialogue with Putin as long as Russia is waging an aggressive war against Ukraine.
"So, I don't see any kind of communication with Putin or with the Russian political leadership in the near future. We all want to find a pathway towards peace, but it seems to me that that pathway happens only through the battlefield at the moment."
Mr Haavisto, who ran as an independent, admitted his defeat.
"Well, Alexander. Congratulations to Finland's 13th president," the 65-year-old said.
"If you ask me today if I'll ever be involved in any elections again, my answer is probably 'no', not for a while and maybe never," added Mr Haavisto, who had also unsuccessfully run for the presidency twice before.
Instead, he said he would would now focus on his job as a lawmaker.
Mr Stubb will officially assume office on 1 March, replacing Sauli Niinisto.
The Finnish head of state is directly responsible for foreign and security policy, and is commander-in-chief of the country's armed forces.