His lawyers sought to overturn the official results that declared Widodo the victor with 55.5 percent of votes, against Subianto's 44.5 percent.
However, according to the results of recapitulation carried out in stages at the polling station, sub-district, district, provincial and national levels by the General Elections Commission (KPU), Joko Widodo-Ma'ruf Amin gained 85,607,362 votes, while Prabowo-Sandiaga totaled 68,650,239 votes, he said.
The court, which also questioned the quality of the evidence and the credibility of witnesses, said voter-fraud claims were the responsibility of Indonesia'selections supervisory agency and beyond its remit.
Widodo said Indonesians should reunite after a divisive election campaign.
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.
Prabowo's legal team had called on the Constitutional Court to have the result of the April 17 election annulled, citing alleged voter fraud and abuse of power.
Earlier, thousands of Prabowo's supporters held peaceful protests near the court as judges read a 6,000-page ruling over almost nine hours. A retired special forces general with links to Mr Prabowo was also accused of masterminding a plot to assassinate top state officials.
On Thursday night, Prabowo appeared before the cameras to say he would respect the court's decision.
With a group backing Prabowo, as Subianto is commonly known, pledging to gather 100,000 people for a rally on Thursday, authorities deployed 47,000 security personnel around the court, the president's palace, parliament and the election commission's offices. The election and the court proceedings had been transparent, he said, calling for unity.
Prabowo and his running mate Sandiaga Uno have urged their supporters to stay off the streets and "watch the verdict at home on television instead", said Andre Rosiade, a campaign spokesman.
The MK ruling reinstates presidential poll results initially announced by the General Election Commission (KPU) that put President Widodo and his running mate Ma'ruf Amin as the victor of presidential election.
"Let there be no more friction, because we are all one Indonesia", said Ma'ruf, former chairman of the Indonesian Ulema Council (MUI).
Jokowi won in provinces where non-Muslims are the majority, such as mainly Hindu Bali and predominantly Christian East Nusa Tenggara, while Prabowo dominated in religiously conservative regions, including Aceh province where Islamic law is enforced.
Minutes after the ruling, Subianto said he had "respect" for it, reducing the risk of more violent protests but also raising the possibility of his party joining Jokowi's government and leaving the world's third-largest democracy without a significant parliamentary opposition.
Game of Thrones Confirmed for Comic-Con 2019
Game Of Thrones Makers Deleted Cersei Lannister's Miscarriage Scene from the Final Season, Actress Lena Headey Reveals Details. And if you are only looking to add season eight to your collection, the show's final year will also be available separately.
Heat index near 100° Sunday; More storms possible
We will keep warming and adding humidity as we head through the start of July thanks to high pressure strengthening over the area. The upper levels of the atmosphere will be cold, and that will give us the chance to see hail, potentially large hail.
West Indies must play for pride at World Cup, says coach
Roach returned impressive figures of 3-36 in his 10 overs, including the wicket of India opener Rohit Sharma for 18. It was an underwhelming response from West Indies after they were economical with the ball and tidy in the field.
How Arsenal Transfer News Affect Their Odds to Win?
Other players rumored to be destined for Arsenal include; Sokratis Papastathopoulos, from Borussia Dortmund, and Saul Niguez. If they are rumored to buy an elite player, during the transfer window, they play well which increases the odds of winning.