Millions of Iranians have turned out to vote in the first polls since last summer’s landmark nuclear agreement and the lifting of sanctions.

The elections are a key test of support for reform and for President Hassan Rouhani. Long queues were reported at polling stations across the country, and electoral authorities extended voting three times until 10pm local time.

Ayatollah Ali Khamenei, the supreme leader of the Islamic Republic, cast his ballot in a Tehran mosque live on state TV minutes after the polls opened at 8am, waving to a phalanx of cameras and urging all citizens to follow his example.

“It is our duty and our right to take part in these elections and that’s why I came early in the morning,” Khamenei said. “My advice to everybody who loves the Islamic Republic of Iran and our great nation is to try to vote very soon.”

Iran elections: why are they important and who is running? Read more

Polling stations across the capital were busy in the first few hours of polling, fuelling expectations of a high turnout that experts said would favour the reformist-moderate alliance and increase support for Rouhani in the 290-seat Majlis, Iran’s parliament. A parallel contest is taking place for the assembly of experts, a clerical body whose 88 members have to choose the supreme leader.

“Turnout has been very satisfactory so far,” said Alireza Seyfan, an official supervising the vote in the Imam Hassan mosque in Narmak, east Tehran, as a couple of dozen people filled out their ballot papers – each requiring a handwritten list of 30 candidates. Papers have to be marked by a fingerprint and countersigned by a supervisor before being placed in a plastic box.

Large crowds were gathering in the winter sunshine on nearby Hafthoze Square, where Irib, the state TV channel, was doing a live broadcast. A giant banner strung overhead reminded citizens of their duty, as expressed by Khamenei: “People should elect those who are not connected to the sources of wealth and power.”

In Samangan, home to the former president Mahmoud Ahmadinejad, dozens of people were waiting outside the Great Mosque, with its beautiful Arabic calligraphy praising the Shia martyr Hussein, an hour before polling started. Later a bus was drafted in to serve as an overflow polling station.

“The economy and inflation are the main issue for me,” said Farsheed, a 24-year-old bank employee. He intended to vote for the reformist “list of hope” of Mohammad Reza Aref, a former vice-president and ally of Mir Hossein Mousavi and Mehdi Karroubi, the Green Movement leaders whose victory in 2009 was “stolen” by Ahmadinejad, and who remain under house arrest.

Facebook Twitter Pinterest Ayatollah Ali Khamenei, Iran’s supreme leader, casts his ballot in Tehran. Photograph: Anadolu Agency/Getty Images

Zahra, a mother of two teenage sons, was supporting the rival conservative list led by Gholam-Ali Haddad-Adel, a close confidant of Khamenei. “I want him because he supports the supreme leader,” said the 42-year-old housewife, whose chief concern was about youth employment. Neither she nor her husband, Mortaza, had seen any improvement in the economy since the lifting of sanctions last month.

In Niavaran, in opulent north Tehran, 200 people were queueing up at lunchtime to vote at the Val-Fajr mosque, men and women in long segregated lines straggling across the courtyard. “The most important thing for me is to stop the radical right getting into the Majlis,” explained Nargis, a computer programmer. “We hope that this time our votes will count – not like what happened in 2009.”

Iran elections: reformists seek political gains but face apathy in key poll Read more

Reformist supporters attach greater importance to parliament than to the assembly of experts, which has a built-in majority for conservatives. Still, close attention is being paid to the performance of Hashemi Rafsanjani, the former president and senior cleric, who has thrown his weight behind Rouhani. Ayatollah Khomeini’s grandson Hassan was disqualified from running for this body.

Iranian officials were keen to advertise the election as another reason for the outside world to engage with their country in the wake of the nuclear agreement. “This is a message to the west – that we have democracy based on Islamic values,” said Ali Bakhsi, a foreign ministry employee who was waiting to cast his vote. He predicted a turnout as high as 70%.

Students from Amir Kabir University expressed strong support for Rouhani – as well as scepticism about whether the vote would change much. “Iran is like a monarchy,” said Namira, a 22-year-old theatre student, her hair barely covered by the required headscarf. “Instead of a shah we have a supreme leader. We have a Majlis, but it only has limited influence.”

Others complained about the disqualification of hundreds of candidates. “But weaker reformists are still better than hardliners,” an engineering student quipped.

No one is predicting trouble in the wake of these polls, though there is some nervousness in the reformist camp about the aftermath. Several hundred foreign journalists who have been given rare visas to report on the elections have been ordered to leave by Sunday. Press passes were being carefully scrutinised by security personnel guarding polling stations.