By Kelly Ng, BBC News
Indonesia's defence minister Prabowo Subianto has been declared the winner of last month's presidential election in the world's third-largest democracy.
Prabowo appealed for unity as his two rivals, Anies Baswedan and Ganjar Pranowo, vowed to contest the result.
The former general, who had been dogged by allegations of human rights abuse for decades, won 58.59 percent of the votes.
He had endeared himself to social media-savvy voters with TikTok videos that cast him as a cuddly grandpa.
"For those who didn't vote for us, give us a chance," the 72-year-old said after the elections commission announced the official count on Wednesday night.
"We will prove that we are a president and vice president who will work as hard as possible for all the Indonesian people," he said.
He will assume office in October, taking over from President Joko Widodo, who is more popularly known as Jokowi.
Eighty percent of 205 million registered voters across 17,000 islands and three time zones trooped to polling centres on 14 February, making it the world's largest single-day election.
Prabowo's votes exceeded the majority required to avoid a runoff. Anies and Ganjar got 25 percent and 16 percent, respectively.
Prabowo thanked the popular Jokowi, whose tacit backing is widely believed to have helped him win. The former general lost two presidential elections to Jokowi in 2014 and 2019.
His running mate - now the vice president-elect - is Jokowi's eldest son, Gibran Rakabuming Raka, who was only able to run only after a last-minute lowering of a minimum age requirement.
Prabowo claimed victory after the election on 14 February when unofficial tallies showed he had a strong lead over his rivals. World leaders have also congratulated him over the past weeks.
On Wednesday, US Secretary of State Antony Blinken extended his "sincere congratulations" and applauded Indonesians for "their robust turnout and commitment to democracy and the rule of law".
German Chancellor Olaf Scholz said in a statement that he looked forward "to deepening our strategic partnership even further", a view echoed by the French foreign ministry.
Anticipating protests from Anies' and Ganjar's supporters, police deployed more than 3000 officers to stand guard across the capital, Jakarta, before official results were announced.
Demonstrators have taken to the streets in the past weeks alleging widespread election fraud.
Among other things, Anies and Ganjar had earlier alleged that Gibran's candidacy was a part of behind-the-scenes manoeuvring that showed Jokowi's partiality for the Prabowo-Gibran camp.
Anies said on Wednesday that there had been election irregularities and that his legal team would take it to court.
"A leadership born out of a sullied process, with deviations, fraud, will produce a regime with unjust policies," Reuters news agency cited him as saying.
The head of Ganjar's legal team had also told BBC Indonesia they would challenge the result in court. They have to do so within the next three days, according to the country's laws.
"There have been a lot of complaints about irregularities. This election in the Reformasi era is considered [by many] to be less free and fair than previous elections in the post-Suharto period," Indonesian professor Dewi Fortuna Anwar told the BBC's Newsday programme on Thursday.
The Reformasi, also known as the Reform era, began with the fall of Indonesia's authoritarian president Suharto in May 1998.
"Academics and civil society organisations throughout the country have been expressing concerns over [alleged] ethical and legal violations, and improper, or you might even say illegal, use of state resources," said Dewi, a professor at the National Research and Innovation Agency in Indonesia.
- This story was first published by the BBC.