Indonesia's highest court has unanimously upheld last month's presidential election result, paving the way for Joko Widodo to take over as leader.
The constitutional court on Thursday rejected the last-ditch attempt by losing presidential candidate Prabowo Subianto to overturn the result he says was tainted by widespread cheating.
The verdict, passed down in Jakarta, cannot be appealed against.
"The court rejects ... all applications from the applicant by all nine judges," said court chief Hamdan Zoelva said.
Widodo, the current governor of Jakarta, is due to take over on October 20.
Prabowo had alleged "massive" fraud in the election and deployed a team of nearly 100 lawyers to challenge the result.
Earlier, thousands of Prabowo supporters had gathered near the court and police fired tear gas and water cannon to disperse those who tried to break through security barriers shortly after the court began its session.
Witnesses said protesters rammed four trucks into the barriers, sparking the police response. A few people were injured and four were arrested. The crowds later largely dispersed.
About 50,000 police and military personnel were on standby around the capital city in case of violence, authorities said.
A spokesman for Prabowo urged his supporters to refrain from violence and said the court's ruling would be respected.
"We will respect the court's decision because it is final and binding," Tantowi Yahya told the Reuters news agency before the final verdict was announced.
The Elections Commission, which has been commended by international observers for its transparency, declared last month Widodo the winner by nearly 8.5 million votes, or more than 53 percent of the vote.
Source: Al Jazeera and agencies