Supporters of an unsuccessful presidential candidate clashed with security forces and set fire to a police dormitory in the Indonesian capital after the release of official election results.

National Police spokesman Dedi Prasetyo said protests turned violent late Tuesday and continued during the night. He said Wednesday that dozens of people were detained.

KompasTV showed protesters throwing rocks, a paramilitary police dormitory on fire, and hundreds of riot police in a central neighborhood of the city.

Indonesia's Election Commission on Tuesday said President Joko Widodo had won a second term with 55.5% of the vote in the April 17 election. His opponent, former general Prabowo Subianto, has refused to accept the results and declared himself the winner.