Final results for the Tehran constituency in Friday’s twin Iranian elections show a sweeping victory for reformist-backed candidates in the race for parliament and the assembly of experts.

The candidates took all but one seat in the assembly – a powerful clerical body responsible for appointing the next supreme leader – and enjoyed a clean sweep of all 30 seats allocated to Tehran in the 290-seat Iranian parliament, the majlis .

Countrywide assembly results have not been announced yet, but reformist-backed candidates and independents allied with President Hassan Rouhani are expected to outnumber conservatives who are against his mandate.

Five lessons from Iran's 2016 elections

Read more

Results from both elections amounted to a humiliating blow to hardliners in Iran, especially those who were intent in their opposition to Rouhani’s moderate agenda, including reaching a landmark nuclear deal with the west.

Surprising gains by moderates and reformists in both elections are seen as a strong vote of confidence to Rouhani, which will significantly boost his chances of seeking re-election in 2017.

A number of prominent hardline figures, who led the anti-Rouhani camp, have been blocked. In Tehran, two ultra-conservative ayatollahs, Mohammad-Taghi Mesbah Yazdi and Mohammad Yazdi, the current chairman, lost their seats in the assembly. Mesbah Yazdi is seen as the spiritual leader who played a crucial role in the rise to power of former hardline president, Mahmoud Ahmadinejad.

The pragmatist Ayatollah Akbar Hashemi Rafsanjani, a key Rouhani ally, topped the list of 16 winners in Tehran in the race for the assembly. Ayatollah Ali Khamenei, the current leader, and Rafsanjani, who was not allowed to run for president in 2013, have been at odds in recent years. Third on that list was Rouhani himself, who was running for a membership in the assembly while being the president. The only winner who was not backed by the reformists was Ahmad Jannati, who won in the 16th place. Jannati is the head of the Guardian Council, an unelected body in charge of vetting candidates before any election.

President Hassan Rouhani casts his ballot in the Iranian capital. Photograph: Xinhua/Barcroft Media

The assembly’s results are in favour of the reformists not because reformist candidates are entering the clerical body but because of alliances with successful moderate-leaning candidates. Hassan Khomeini – a grandson of the founder of the Islamic Republic, who was the reformist’s main candidate in the race for the assembly – was disqualified. Many of the Tehran winners for the assembly are in fact conservatives but reformists were backing them in the hope of blocking hardliners.

On Sunday, Khamenei praised the high turnout, a sign that he approved of the results, and said it was a testament to the country’s “religious democracy”. “I thank Iran’s wise and determined nation ... and I hope the next parliament will act responsibly towards people and God,” he said in a statement published in the local media.

In Tehran’s parliamentary race, a coalition of candidates supported by the reformists, dubbed “the list of hope”, took all of the capital’s 30 parliamentary seats. Mohammad Reza Aref, a committed reformist who has a degree from Stanford University in the US, is at the top of the list. Gholam-Ali Haddad-Adel, a hardliner close to Khamenei, whose name topped the list of “principalist” candidates, lose his seat in the parliament.

The results in the provinces are still unclear, but in the race for the parliament a combination of moderates and independents sympathetic to Rouhani are leading. Results may not be finalised until Tuesday, but if they tally with the initial figures there will be a palpable change in the Iranian political landscape, with moderates dominating the scene and hardliners being pushed to the fringes.

Strong gains by supporters of Rouhani could help promote greater opening to the west by Iran and limit political advances by conservatives at home – and secure him a second term in office next year.

Up to 20 women are expected to win parliamentary seats, a record for Iran. Among them is the reformist candidate Parvaneh Salahshori, who said in a recent foreign media interview that women should have a choice to wear the hijab. The issue is a taboo subject in the Islamic Republic.