Indonesia's President Joko Widodo said authorities have the volatile situation in the capital Jakarta under control following riots by supporters of his rival in last month's presidential election.

Police say six people have died and dozens were injured in rioting that began late Tuesday evening following the release of official election results showing Widodo had won a second term.

Flanked by the military chief and other top leaders, Widodo said, "I will work together with anyone to advance this country, but I will not tolerate anyone who disrupts the security, democratic processes and unity of our beloved nation."

Supporters of former special forces general Prabowo Subianto burned vehicles and threw rocks and Molotov cocktails at police, who responded with tear gas and rubber bullets.

Police have said the rioting was planned rather than spontaneous. Subianto has refused to concede defeat to Widodo in the April 17 election. He instead declared himself the winner and plans a court challenge.

Supervisory agency dismisses cheating claims

Widodo won more than 85 million votes of a total of 154 million cast in the world's third-largest democracy, but Prabowo told reporters he believed there had been widespread cheating.

The retired general pledged he would "continue to make legal efforts in line with the constitution to defend the mandate of the people," with his legal director stating the campaign planned to contest the result in the Constitutional Court.

On Monday, an election supervisory agency dismissed claims of systematic cheating, citing a lack of evidence. Independent observers have said the poll was free and fair.

Riot police officers take their position outside the building that house the Election Supervision Board in Jakarta on Wednesday. (Dita Alangkara/The Associated Press)

Widodo was congratulated for winning the election by former president and Democratic Party chairman Susilo Bambang Yudhoyono, who is part of the coalition backing Prabowo.

The National Mandate Party (PAN), which is also part of the Prabowo coalition, has also acknowledged the results of the election, which are being rejected by Prabowo's Great Indonesia Movement (Gerindra).

Presidential Chief of Staff Moeldoko told reporters on Wednesday he believed there was "a systematic effort by a certain group, outside of the terrorist group, that is riding on the situation to muddy the situation," adding that authorities have seized two pistols from people involved in riots.

"We know who is behind this, it is a matter of time," he said, adding that security was under control.

At least 20 arrested

Police spokesperson Dedi Prasetyo told Reuters on Wednesday that Indonesian police had arrested at least 20 people for provoking the riots and were checking on reports of casualties.

He stressed that security officers on the ground, which include military personnel, were not equipped with live bullets.

Heavily armed Indonesian troops were on high alert amid fears of civil unrest in the capital Jakarta, as the surprise early announcement of official election results handed Joko Widodo another term. (Bay Ismoyo/AFP/Getty Images)

News website Tirto reported a man died of bullet wounds in Tanah Abang, quoting a doctor at a hospital near the site.

Indonesian authorities say 40,000 police and army personnel are on duty across Jakarta to maintain security.

Australia, the United States, and Britain issued travel advisories warning of an increased risk of violence across Indonesia and advising citizens to stay away from protests. Canadian travellers are advised to "exercise a high degree of caution" in the country because of "political and social tensions and the threat of terrorism throughout the country."