Influential religious leader Muqtada al-Sadr has told thousands of supporters in Iraq's capital, Baghdad, that he will boycott upcoming elections unless the country's electoral law is changed.

Supporters of the Shia cleric have repeatedly rallied for changes to the law and the country's electoral committee, which is dominated by affiliates of powerful political parties.

If "the law remains ... this means that we will order a boycott of the elections," Sadr said in remarks televised at Friday's demonstration in Baghdad's Tahrir Square.

Iraq is set to hold holding provincial elections later this year, and parliamentary elections in 2018.

Sadr, a vocal critic of Prime Minister Haider al-Abadi, did not specify the specific changes he wants to take place, but the current law has been criticised as being biased towards large political parties over smaller ones.

The United Nations has backed demands for electoral reform, urging parliament last month to "finalise the ongoing review" of the election law and the electoral commission.

OPINION: The reinvention of Muqtada al-Sadr

Sadr is the scion of a powerful clerical family who, in earlier years, raised a rebellion against US-led forces and commanded a feared militia.

He had lost some of his political influence in recent years but has brought himself back into relevance by calling for demonstrations to push for reforms.

Al Jazeera's Stefanie Dekker, reporting from Erbil in northern Iraq, said Friday's demonstration showed Sadr has the ability to mobilise thousands of people.

"What we're seeing really has to do with internal Iraqi politics. [Sadr's] been campaigning on an anti-corruption platform - how politicians and the electoral commission are corrupt. This is important because Iraq will have provincial elections later this year.

"He's been highlighting this for over a year now but since the Mosul offensive [against ISIL] ... it's slowed down and attention has shifted.

"So this is an apparent effort by him to re-launch his campaign and remind people of his message - and thousands are heeding his call."

Rallies demanding improved services and opposing widespread corruption broke out in the summer of 2015, drawing pledges from authorities that reforms would be made that ultimately led to little in the way of lasting change.

Last year, his supporters broke into Baghdad's fortified Green Zone area on several occasions, where the government is headquartered, while clashes at a Baghdad protest in February left seven people dead.