Rouhani is hoping his supporters will take control of the 290-seat parliament and end years of dominance by conservative factions.
The poll for the Assembly of Experts, which will coincide with parliamentary elections for the first time, could also be pivotal as it will choose the next Supreme Leader if the 76-year-old Khamenei dies during its eight-year term.
“Everyone should participate in the elections; even those who do not accept the ruling system should participate for the sake of the country’s standing,” Khamenei was quoted as saying by Iranian news agencies.
A record 12,000 candidates have nominated themselves for parliament but the Guardian Council, an unelected judicial body that vets candidates on technical and ideological grounds, is likely to disqualify several thousand of them before voters go to the polls.
Candidates for the Assembly of Experts include prominent centrists such as Rouhani; former presidents Akbar Hashemi Rafsanjani and Mohammad Khatami; and Hassan Khomeini, the grandson of the Islamic Republic’s founder Ayatollah Ruhollah Khomeini.
The younger Khomeini, 43, is seen as close to the reformist camp and is the first member of his family to test his popularity at the polls. Hardliners have campaigned against his candidacy, but Khamenei has given him a cautious blessing to proceed.