Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

DUBAI — Iran's President Hassan Rouhani and his allies won big gains in elections that could deepen the country's engagement with the world after his government agreed to curb its nuclear program.

Despite the results, the conservative Islamic establishment retains decisive power due to Iran's unique dual system of clerical and republican rule.

Iranian President Hassan Rouhani after casting his vote on Friday. Reuters

Most of the lawmakers who did not make it to the new parliament strongly opposed the nuclear deal — including Mehdi Koochakzadeh, who called Foreign Minister Mohammad Javad Zarif "a traitor" and Roohollah Hosseinian, who threatened to bury the negotiators under cement for agreeing to concessions to world powers.

"This election can be a turning point in the history of the Islamic Republic," said an editorial in reformist newspaper Mardom-Salari, whose managing editor, Mostafa Kavakebian, won a parliamentary seat in Tehran according to the early results.

Rouhani and allied centrists and reformers won 15 out of the 16 Tehran seats in the Assembly of Experts, final election results for Tehran showed, ousting two prominent conservatives including the speaker of the powerful clerical body.

"The biggest achievement of this election is the return of reformists to the ruling system... so they won't be called seditionists or infiltrators anymore," he said, referring to hardliners who accused reformists of links to the West.

The results were carried on state news agency IRNA.

Conservatives currently dominate the 88-member body, which is tasked with choosing the next supreme leader, the country's most powerful position.

The twin polls, for the assembly and parliament, were seen by analysts as a crucial moment for Iran after years of isolation, and a vote of confidence in Rouhani's government and his detente policy with the West.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Rouhani's allies were also due to take all 30 parliamentary seats in the Tehran constituency, according to preliminary results, up from just two previously.

But their gains outside the capital were more limited, with conservatives keeping hold of many seats in both bodies.

The hardline chairman of the Assembly of Experts, Mohammad Yazdi, lost his seat. So did Mohammad-Taghi Mesbah-Yazdi, an arch-conservative who was widely seen as the spiritual mentor to former conservative president Mahmoud Ahmadinejad.

Related: Iran Election Seen as Showdown Between Reformers, Hard-Liners

A prominent exception was Ahmad Jannati, who squeezed in at 16th place. Jannati is also the chairman of the Guardian Council, a cleric vetting body that disqualified the majority of reformist candidates from running for the elections.

Leading conservative lawmakers who opposed Iran's new oil and gas contracts aimed at attracting foreign investment and economic reforms proposed by Rouhani’s government, also lost their seats, according to final results.

That opens the way for changes to economic policy that will boost foreign investment and trade with the West, businessmen and analysts said. The outgoing parliament had acted as a brake on Rouhani's plans to strengthen the private sector, tackle corruption and welcome foreign investors.

"In economic affairs the next parliament will be much better than the current parliament," said economist Saeed Leylaz, once an advisor to reformist former president Mohammad Khatami.

In his first comment since the polls, Iran's deeply anti-Western Supreme Leader Ayatollah Ali Khamenei praised the high turnout. He made no direct comment on the results but suggested the newly elected bodies should not be influenced by the West.

Hossein Shariatmadari, editor-in-chief of Kayhan, a newspaper closely associated with Khamenei, accused reformists of trying to create what he called an "illusion of a victory."

"The structure of the Iran’s ruling system is such that no political faction can change the main policies rooted in its core principles. People’s vote is limited to the responsibility they have been given in the constitution," Shariatmadari wrote.

Iran's political system places significant power in the hands of the conservative Islamic establishment including the Guardian Council, which vets all laws passed by parliament.

A Reuters tally of official results published so far suggested a strong showing by the pro-Rouhani camp and independents. Reformists had 58 seats, conservatives 105, and independents 46, results showed, excluding Tehran where results remain preliminary.