The violence has been fanned by claims from Widodo’s rival Prabowo Subianto, a retired general, that the April 17 poll was a fraud.
Indonesia’s election commission on Tuesday confirmed Widodo had beaten Subianto, who has until Friday to challenge the results at the Constitutional Court.
The 67-year-old has appealed for calm and said he would pursue legal channels, as he did, unsuccessfully, against Widodo in the 2014 election.
Election officials and analysts discounted Subianto’s claims of rampant cheating in the world’s third-biggest democracy, after India and the United States.
The government has partly blocked access to social media — including Twitter, Facebook and Instagram — in a bid to clamp down on fake news and hoaxes linked to the violence.
On Wednesday evening, the area around the election supervisory agency’s office erupted in fresh skirmishes with thousands of protesters chanting and waving Indonesian flags.
Some hurled stones, fireworks and molotov cocktails at riot police who lined up behind a razor wire barricade near the election supervisory agency building, where a police post was torched.
Police pushed back the main group of rioters after firing tear gas and rubber bullets at the demonstrators.
An Australian Broadcasting Corporation news crew said it was attacked without warning by a mob.
Indonesia’s capital has been gripped by bigger demonstrations in the past, but the level of violence in this week’s clashes has not been seen in years.
Among the half-dozen people killed was a 17-year-old high school student and a 19-year-old, according to local media.
Authorities said the victims died from gunshots or blunt force trauma, but denied that they fired live rounds on the crowds. It remained unclear who was responsible for their deaths.
By Thursday morning, Jakarta’s streets were relatively quiet as the police and military kept a close watch on buildings in the downtown core, including the election supervisory agency building — the centre of much of the violence — as well as parliament, embassies and the presidential palace amid fears of more unrest.
Nearly 60,000 security personnel were deployed Thursday, nearly double the previous number, after Widodo vowed that he “won’t tolerate” more riots.
Authorities have blamed the violence on “provocateurs” that they claimed had come from outside Jakarta to stir up trouble.
“We’ve detained more than 300 suspects and are now interrogating them,” said national police spokesman Dedi Prasetyo.
Elsewhere, smaller election protests were held in Sumatra’s Medan city and in Pontianak on Borneo island, where over 500 demonstrators armed with stones and firecrackers blocked roads, damaged vehicles and set two police posts alight, local police said.