Joko Widodo has officially won Indonesia's presidential election and called for the country to unify after a deeply divisive poll that ended with his rival quitting in controversy.
Indonesia's electoral commission on Tuesday night announced Jakarta's popular governor had won with 53 percent - or more than 70 million votes - in the hard-fought 9 July poll.
Hours before the declaration, which had already been predicted by several credible surveys, rival candidate Prabowo Subianto condemned the election process.
The former general said he and his vice presidential candidate rejected the "legally tainted" poll and said he would withdraw from the process. His coalition's witnesses walked out of the electoral commission, where tallying was in its final stages.
More than 3000 riot police fortified the building in central Jakarta, but supporters of the divergent camps heeded advice to stay at home.
The close result and polarising nature of the candidates raised fears of riots, particularly for Jakarta residents with memories of the trouble that came with the fall of former president Suharto in 1998.
Mr Joko, better known as Jokowi, made his acceptance speech from a wooden boat at Sunda Kelapa, Jakarta's old port, with vice president-elect Jusuf Kalla.
Mr Joko thanked his rival and called for an end to the partisanship that has split Indonesia.
Referring to the numbers one and two that have designated the rival tickets, and his famous "Salam Dua Jari" (Two Finger Greeting) campaign song, he proposed a new unified slogan - "Salam Tiga Jari" (Three Finger Greeting). "Forget number one, forget number two," Mr Joko said. "Let's go back to one Indonesia."
The declaration caps a remarkable rise for the 53-year-old whose journey from bamboo shack to president has shaken Indonesia's establishment and inspired millions of ordinary citizens.
As mayor of the central Java city of Solo and governor of Jakarta, he has been lauded as a hands-on reformist.
It was unclear on Tuesday whether Mr Prabowo, 62, still intended to challenge the election in the constitutional court, however AAP reports most analysts doubt he would have the grounds to succeed. Mr Joko is expected to be inaugurated on 20 October.