The 70-year-old retired lieutenant colonel secured massive support in majority Sinhalese constituencies and had 52.87 percent of the vote, according to early official results of Saturday's poll.
Sri Lanka's former wartime defence secretary Gotabaya Rajapaksa has won the presidency with a clear majority, his spokesman told AFP on Sunday, a day after the polls.
"We got between 53 to 54 percent (of the vote)," Keheliya Rambukwella said as official results showed the 70-year-old heading to victory in Saturday's fiercely contested election.
The 70-year-old retired lieutenant colonel secured massive support in majority Sinhalese constituencies and had 52.87 per cent of the vote, according to early official results of Saturday's poll.
His younger rival, Housing minister Sajith Premadasa, 52, was trailing with 39.67 per cent in the first half a million votes counted. He had strong support in minority Tamil areas and a poor showing in larger Sinhalese constituencies.
Leftist Anura Kumara Dissanayake was in third place with less than five per cent of the vote. There were 32 other candidates for the top job.
Election Commission chairman Mahinda Deshapriya said at least 80 per cent of the 15.99 million eligible voters participated in Saturday's poll, which was marred by isolated violence that left several people injured.
Rajapaksa conducted a nationalist campaign with a promise of security and a vow to crush religious extremism following the April 21 suicide bomb attacks blamed on a homegrown jihadi group.
Three luxury hotels and three churches were targeted in the coordinated bombings. The Islamic State too claimed responsibility for the attack which also left 45 foreigners dead.
Saturday's poll was the first popularity test of the United National Party (UNP) government of Prime Minister Ranil Wickremesinghe who stepped aside and allowed his deputy Premadasa to stand in the election.
Costly intelligence failure
Wickremesinghe's administration faced severe criticism for failing to prevent the attacks despite prior warnings from an intelligence agency of neighbouring India, according to findings of a parliamentary investigation.
Premadasa also offered better security and a pledge to make a former war general, Sarath Fonseka, his national security chief and projected himself as a victim seeking to crush terrorism.
He is the son of assassinated ex-president Ranasinghe Premadasa who fell victim to a tamil rebel suicide bomber in May 1993.
Gotabaya is credited with directing security forces to crush Tamil rebels and end a 37-year separatist war in May 2009 during the tenure of his elder brother Mahinda, who was president from 2005 to 2015.
The Rajapaksas are adored by Sri Lanka's Sinhalese majority, as well as the powerful Buddhist clergy, for defeating Tamil Tiger separatists and ending a 37-year civil war in 2009.
But they are detested and feared by many Tamils, who make up 15 per cent of the population. The conflict ended with some 40,000 Tamil civilians allegedly killed by the army.
Some in the Muslim community, who make up 10 per cent of the population, are also fearful of Gotabaya becoming president, having faced days of mob violence in the wake of the April attacks.
Under his brother, Gotabaya was defence secretary and effectively ran the security forces, allegedly overseeing "death squads" that bumped off rivals, journalists and others. He denies the allegations.
During that time Sri Lanka also borrowed heavily from China for infrastructure projects and even allowed two Chinese submarines to dock in Colombo in 2014, alarming Western countries as well as India.
The projects ballooned Sri Lanka's debts and many turned into white elephants -- such as an airport in the south devoid of airlines -- mired in corruption allegations.
China also offered Sri Lanka "international diplomatic protection" against criticism for its rights record, analyst Paikiasothy Saravanamuttu told AFP.
The Rajapaksas "spent and spent without giving any consideration to how it has to be paid back."
Unlike in 2015 when there were bomb attacks and shootings, this election was relatively peaceful by the standards of Sri Lanka's fiery politics.
The only major incident was on Saturday when gunmen fired at two vehicles in a convoy of at least 100 buses taking voters from the Muslim minority to vote. Two people were injured.
After a campaign that according to the Election Commission was the worst ever for hate speech and misinformation, final results could come by later Sunday.