Gotabaya Rajapaksa is declared the winner in a poll that has split the country along ethnic lines.
Sri Lanka's former wartime defence chief Gotabaya Rajapaksa has won a presidential election that has split the country along ethnic lines.
Official results showed Mr Rajapaksa, 70, took 52.25% of the vote. His rival Sajith Premadasa had already conceded.
Mr Rajapaksa was the clear victor in Sinhalese majority areas while Mr Premadasa scored better in the Tamil-dominated north.
The election is Sri Lanka's first since the deadly Easter Sunday attacks.
Militants linked to the Islamic State group targeted churches and high-end hotels across the island in April, killing more than 250 people. As a result, national security was seen as a dominant issue ahead of the vote.
Mr Rajapaksa, who has positioned himself as a strong figure who can assure Sri Lankans' security, is a highly controversial figure among the country's more than two million Tamils.
He and his brother Mahinda Rajapaksa, the former president, spearheaded the defeat of separatist Tamil Tiger rebels in 2009, ending a decades-long war in which at least 100,000 people died.
Several journalists who were critics of the government when the Rajapaksas led Sri Lanka from 2005-2015 were abducted, tortured and killed. Thousands of people, particularly Tamils, vanished in what have been described as enforced disappearances.
Earlier this year, Gotabaya Rajapaksa told the BBC that war crimes allegations against him were "baseless"
Votes appeared to be starkly divided between the Sinhala Buddhist majority and minority Tamil, Hindu and Muslim groups, raising fears about the future of reconciliation in a country that remains heavily polarised along ethnic and religious lines a decade after the end of the bitter war.
After his election win, Mr Rajapaksa made a call for unity in the country.
"It is my duty to serve all Sri Lankans without racial or religious discrimination," he said. "I promise to discharge my duties in a fair manner."
Human rights groups expressed concern about accountability for wartime abuses - which were committed by both sides - given the election of a man so closely associated with the end of the conflict.
Mr Premadasa, who took 42% of the vote, publicly conceded when partial results showed Mr Rajapaksa was certain to emerge the winner.
"It is my privilege to honour the decision of the people and congratulate Mr Gotabaya Rajapaksa on his election as the seventh president of Sri Lanka," Mr Premadasa said.
Turnout was 83.7%, the election commission said. Mr Rajapaksa is due to be sworn in at a ceremony on Monday.