Finland's conservative ex-PM Stubb wins presidential elections
Stubb garnered 51.6% of the vote to Haavisto's 48.4%, public broadcaster Yle projected after 98% of the ballots were counted.
The result was closer than expected, with pre-election opinion polls having put Stubb in a more commanding lead.
Yle said Haavisto did well in cities and university towns while Stubb did better in the suburbs and rural areas.
Haavisto congratulated Stubb on his victory as soon as the broadcaster made its call.
In his first remarks as the incoming president, Stubb called the win the greatest honor of his life.
He will take office at the beginning of March, succeeding popular President Sauli Niinisto, who has completed two six-year terms and is not permitted to stand again.
Despite the loss, the close election result is a success for Haavisto, with just under 100,000 separating him from Stubb in the final tally that defied pollster predictions of a far clearer lead for Stubb.
The Finnish president is elected directly and holds significant powers in foreign and security policy, apart from their ceremonial role.
Finland shares a 1,340-kilometer border with Russia. Under Niinisto and in the wake of the Russian invasion of Ukraine, the Nordic country decided to apply for NATO membership in 2022. After decades of military non-alignment, it became the 31st member of the defense alliance in April 2023.
Haavisto actually signed the country's NATO accession document in April 2023 as the then-foreign minister under Prime Minister Sanna Marin. Finnish conservative leader Petteri Orpo became prime minister two months later.
Finland's relationship with Russia has drastically deteriorated since joining NATO.
The crossings along the Russian-Finnish border have been closed for several months, and just days ago the Finnish government extended this measure until mid-April.
Helsinki accuses Moscow of deliberately bringing asylum seekers to the border without the necessary documents in order to sow discord in Finland.
Stubb and Haavisto received the most votes of the nine candidates in the first round, held on Jan. 28. In that contest, Stubb got 27.2% of the vote, Haavisto 25.8%.
They beat out other heavyweights in Finnish politics, such as right-wing populist parliamentary speaker Jussi Halla-aho and former EU commissioner Olli Rehn. Stubb served as prime minister from 2014 to 2015.