The defeated candidate in Indonesia’s presidential election has filed a challenge against the result in the country’s top court, just days after seven people died in rioting by his supporters in the capital.

The legal move is the latest step in what analysts say has been a months-long campaign by former general Prabowo Subianto to discredit the election.

Members of his campaign including his brother, Hashim Djojohadikusumo, arrived on Friday night at the constitutional court in Jakarta, where a large digital clock was counting down the time left for challenges to the election. The court has a month to make its judgment.

The election commission said on Tuesday that president Joko Widodo had won re-election with 55% of the vote on 17 April, in a poll that is widely regarded as free and fair.

Subianto, who also lost to Widodo in 2014, has declared himself the winner and alleged massive fraud but has provided no credible evidence.

The election supervisory agency earlier this week rejected Subianto’s complaint about the election’s integrity after evidence of vote rigging provided by his team consisted of printouts of online articles.

The results sparked rioting in Jakarta on Tuesday which police say was orchestrated.

In daylight hours Wednesday’s protest in central Jakarta was peaceful, with supporters of Subianto calling for an investigation and waving Islamic and Indonesian flags. Some held flowers and signs denouncing the deaths of six protestors the night before.

A poster showing Indonesian one-time presidential candidate Prabowo Subianto, left. Photograph: Ed Wray/Getty Images

By nightfall many had left the demonstration, but authorities struggled to disperse a group of angry youths, who hurled rocks and fireworks over a razor-wire barricade. Police pushed back the main group of rioters after firing tear gas and rubber bullets. Reports said 250 people were arrested.

In a televised address that day, the president said the volatile situation, some of the worst political violence Indonesia has seen in recent decades, was under control.

Flanked by the military chief and his vice president, Widodo said: “I will work together with anyone to advance this country, but I will not tolerate anyone who disrupts the security, democratic processes and unity of our beloved nation.”

Nearly 60,000 security personnel were deployed on to the streets on Thursday, nearly double the number when rioting began. Tens of thousands of police and soldiers remain on high alert in the capital.

Associated Press contributed to this report