-- Premadasa conceded defeat
-- First election after Easter Sunday attacks
-- Former wartime defence chief has vowed to tackle extremism
-- Rajapaksa family seen close to China
-- Deep ethnic and religious divisions in Sri Lanka
Sri Lanka's former wartime defence chief Gotabaya Rajapaksa was set to become president after his main rival conceded defeat on Sunday in an election that came months after bombings by Islamist militants threw the country into turmoil.
Rajapaksa oversaw the military defeat of Tamil separatists under his brother and then president Mahinda Rajapaksa 10 years ago. He has promised strong leadership to secure the island of 22 million people, the majority of whom are Sinhalese Buddhists.
Rajapaksa, 70, would be the latest nationalist leader swept to power across the world, tapping into the anger and fears of majority communities.
He and his brothers, who are expected to get key positions, are also seen as closer to China, which has invested billions of dollars building ports, expressways and power stations.
But these projects have also led to high debt levels for Sri Lanka.
In his first comments, Rajapaksa struck a conciliatory note, suggesting he would be a leader of all Sri Lankans, regardless of their ethnic and religious identities.
"As we usher in a new journey for Sri Lanka, we must remember that all Sri Lankans are part of this journey. Let us rejoice peacefully, with dignity and discipline in the same manner in which we campaigned," Rajapaksa said in a tweet.
Tamil political parties are strongly opposed to Rajapaksa, who has faced allegations of widespread human rights violations of civilians in the final stages of the war against the separatists in 2009.
Rajapaksa and his brother deny the allegations.
Muslims, the other large minority group, say they too have faced hostility since the April attacks on hotels and churches in which more than 250 people were killed. Islamic State claimed responsibility.
With half the votes counted from Saturday's election, Rajapaksa led with 50.7 percent, while his main rival Sajith Premadasa had 43.8 percent, the election commission said.
Premadasa, a housing minister in the current government that has faced criticism for failing to protect Sri Lankans in the wake of the suicide bombings in April, conceded defeat.
"At the conclusion of a hard fought and spirited election campaign, 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," Premadasa said.
Millions voted to elect a new president to lead the country out of its deepest economic slump in over 15 years, dragged down by its tourism sector following the bombings.
His victory margin showed huge support in the Sinhalese-dominated southern parts of the island.
Premadasa, who campaigned on policies to help the poor, led in the north and east where minority Tamils are predominant.
He urged Rajapaksa to ensure he took all Sri Lankans along and not target those who opposed him in the election.
"I also urge Mr. Rajapaksa to ensure that the post-election environment is peaceful, and that no citizen or New Democratic Party supporter is persecuted or harmed for their role in supporting my candidacy," he said, referring to his party.