Indonesian President Joko Widodo has declared victory in Wednesday’s election, even as his challenger continues to contest the result.
Former general Prabowo Subianto claimed he had won and that his camp had evidence of “widespread cheating”.
Official results will not be out until May but “quick counts” by polling companies have given Mr Widodo a lead of about 10 percentage points.
Authorities have appealed for calm and vowed to tackle any unrest.
“If there are any illegal or unconstitutional actions that threaten public stability and security, [the authorities] will take firm action,” said National Police Chief Tito Karnavian.
Wednesday’s election in the world’s third-largest democracy followed a bitter campaign in which religion played a key role.
Indonesia, a vast archipelago, is home to the world’s largest Muslim population and has more than 260 million people.
More than 192 million were eligible to cast their ballot to select 20,000 local and national lawmakers, including the president.
On Thursday, Mr Widodo told a press conference that he had won the vote with 54.5% – based on counts by 12 pollsters. Leaders from more than 20 countries had already called to congratulate him, he said.
Mr Widodo also said the quick counts of sample votes were highly accurate and that the country should “patiently wait” for official results.
Minutes later, Mr Prabowo told reporters his camp was declaring victory because it had “evidence of widespread cheating at the village, sub-district and district levels across Indonesia”. He said he had won with 62% of the vote.
At the last election in 2014, Mr Prabowo also challenged results, alleged widespread fraud and declared victory after losing to Mr Widodo. The Constitutional Court upheld the result after rejecting his legal challenge.
Indonesian stocks surged on Thursday morning as investors reacted to the expectation that Mr Widodo had won a second five-year term.