Indonesia's Election Commission says the official count from last month's presidential election shows President Joko Widodo won 55.5% of the vote, securing him a second term.

The official result from the April 17 election was completed early Tuesday and was almost the same as the preliminary "quick count" results drawn from a sample of polling stations on election day.

Widodo's challenger for a second time, former general Prabowo Subianto, has refused to accept defeat and declared himself the winner last month.

Thousands of police and soldiers are on high alert in the capital Jakarta, anticipating protests from Subianto's supporters.