Iran's President Hassan Rouhani criticised conservative opponents for trying to sabotage the nuclear deal with world powers and vowed more civil rights during Friday's second presidential election debate.
In rare criticism of the elite Revolutionary Guards, Rouhani slammed the decision to write anti-Israel messages on ballistic missiles before testing them.
"We saw how they wrote slogans on missiles and showed underground (missile) cities to disrupt the JCPOA (nuclear deal)," he said during the debate, which comes ahead of the May 19 election.
"Our nation got through these issues because the majority of society chose morality and Islam from day one," he added.
Iran argues that the missile tests are not banned under the 2015 deal, which curbed its nuclear programme in exchange for a lifting of certain sanctions, but they have heightened tensions with the US and Israel.
Rouhani said his conservative opponents in the election were linked to those trying to scupper the deal and broader outreach to the West.
"When our diplomats were negotiating the deal, what were you doing behind the scenes? Some people acted like the opponents of the Iranian people," he said.
One of his main challengers, hardline cleric Ebrahim Raisi, said he would not tear up the nuclear accord but slammed what he called the government's weak stance and empty promises.
"We should not show any weakness in the face of the enemy," said Raisi, who had a more lively debate after a lacklustre showing in the first round last week.
"This agreement was like a cheque that the government has been unable to cash. Mr Rouhani promised that after the signing of the deal all the sanctions would be lifted and people's lives would improve, but they have not," he said.
Rouhani hit back with a spirited defence of the nuclear deal, saying it had allowed a massive increase in oil sales and opened the way for Iran to take a central position in regional diplomacy.
"It is unprecedented that Iran has such an important role," he said, referring to this week's talks on Syria alongside Russia and Turkey.
Rouhani also vowed to improve civil rights -- a crucial plank of his 2013 presidential campaign which has been stymied by the conservative judiciary and security forces.
"Civil rights are not just on paper, they will turn into practice. We will hold different sectors responsible," he said.
The other main hardline challenger, Tehran mayor Mohammed Bagher Ghalibaf, sought to score points on the stagnant economy, seen as Rouhani's main weakness.
Ghalibaf returned frequently to his favourite theme -- attacking the elite "four-percenters", a nod to the global "We are the 99-percent" campaign.
"Who has benefited (from the nuclear deal)? The four-percenters. Who has been hurt? The people," he said.
Six candidates were selected last month by the conservative-controlled Guardian Council, which rejected more than 1,600 applicants.
Split evenly between three conservatives and three moderate-reformists, the debates have the flavour of a team event.
Many expect the other moderate candidates -- vice-president Eshaq Jahangiri and Mostafa Hashemitaba -- to withdraw at the last minute to boost Rouhani's chances.
Jahangiri surprised viewers with a forceful and charismatic turn in the first debate, leading some to speculate he could challenge his boss, although this time he was on more subdued form.
The conservatives were fatally split in 2013, and it is still unclear whether Raisi, Ghalibaf or the third conservative -- Mostafa Mirsalim -- will agree to rally round the most likely contender.