Indonesia's President Joko Widodo has called for unity after the Constitutional Court upheld his election win and dismissed opposition claims of a rigged vote.
Indonesia's Constitutional Court has upheld the victory of President Joko Widodo in April's election, dismissing allegations by the opposition the vote was rigged.
Widodo won re-election by a double-digit margin, an official count released last month showed. But his rival, retired general Prabowo Subianto, refused to concede defeat and went to court, citing systematic fraud and abuse of power.
Prabowo's supporters had clashed with police last month when the General Election Commission (KPU) released official results, in some of the worst civil unrest in years in Jakarta.
"I urge all Indonesians to reunite to advance the country," Widodo told reporters after the court decision on Thursday and just before he was due to fly to Japan for a G20 summit.
The panel of nine judges unanimously dismissed the opposition's case in its entirety, saying there was no evidence to support claims of cheating.
They said claims that Widodo had misused state funds and the state apparatus to drum up support, that press freedom had been restricted during the campaign, and that there had been voter intimidation and vote-buying were all unfounded.
The court's verdict is final and no appeal can be lodged.
Earlier, thousands of Prabowo's supporters held peaceful protests near the court as the judges read a 6000-page ruling over nearly nine hours. Most appeared to have dispersed after dark.
Prabowo, flanked by his running mate Sandiaga Uno at his residence in Jakarta, said he would "honour the ruling of the Constitutional Court" but said it was "very disappointing". He urged his supporters to remain calm.
Prabowo's brother, Hashim Djojohadikusumo, last week told reporters his camp was considering joining hands with the government after saying Widodo's team had "offered" cabinet posts.
Nearly 50,000 security personnel were deployed in Jakarta for the court's verdict, and police blocked roads near the court.
At least nine people were killed and 900 injured in two nights of the violence in Jakarta last month, with police firing tear gas and rubber bullets and protesters charging them with rocks, sticks and firecrackers.
Amnesty International Indonesia said police used excessive force and accused officers of torturing several people while trying to contain the riots.
Authorities have blamed last month's violence on several groups, saying many of the rioters were paid, and also accused a retired special forces general with links to Prabowo of masterminding a plot to assassinate top state officials during the unrest.
Prabowo and his running mate had urged supporters this week to stay off the streets and "watch the verdict at home on television instead", said Andre Rosiade, a campaign spokesman.
Prabowo's legal team had also called on the court to disqualify Widodo's ticket on the grounds that his running mate, Ma'ruf Amin, failed to resign from an advisory position on the board of a state-controlled bank as required by election law. The court also dismissed this argument.
"This is not just a victory for Jokowi but also for Indonesia's electoral system, after a long and gruelling campaign," said Ben Bland, director of the Southeast Asia project at the Lowy Institute in Sydney, referring to the president by his nickname.
"Hopefully, the president can now get on with tackling the many challenges facing Indonesia, and start delivering on his promises to make much-needed structural reforms," he said.