ANKARA (Reuters) - Known for years as a mild-mannered cleric, Iran’s President Hassan Rouhani has reinvented himself as a rabble-rousing political street fighter to shore up his chances in an unexpectedly tight race against a united conservative bloc.

FILE PHOTO: Iran's President Hassan Rouhani gestures as he registers to run for a second four-year term in the May election, in Tehran, Iran, April 14, 2017. President.ir/Handout/File Photo via REUTERS

A pragmatist rather than a gung-ho reformer, Rouhani has tried to fire up the pro-reform camp with speeches that break taboos by targeting Iran’s hardline elite, from the conservative judiciary to the powerful Revolutionary Guards.

Rouhani’s rival is cleric Ebrahim Raisi, who has gathered the hardline camp behind him and appears to have the backing of Supreme Leader Ayatollah Ali Khamenei.

Rouhani says a hardline victory could put Iran on a more confrontational course with the West, and would prevent the opening of society that a majority of Iranians, especially the youth, yearn to see.

“You want to limit people’s freedom. Voters will confront you in the election. We have chosen our path, the path to freedom. We will not retreat,” Rouhani said in a campaign rally.

He has openly criticized the human rights record of the authorities, speaking at rallies about “those who cut out tongues and sewed mouths shut”. In a debate last week he accused Raisi of seeking to “abuse religion for power”.

All this is a departure from a man known for decades as a loyal member of the Iranian ruling establishment.

“Rouhani is a regime insider. He is loyal to the establishment. He is not a reformist but a bridge between hardliners and reformists,” said a former senior official.

HIGH HOPES

Born into a religious family in 1948 and rising to the middle ranks within the Shi’ite clergy, Rouhani was active in the revolution that overthrew the U.S.-backed Shah in 1979. He has held several sensitive jobs in the Islamic Republic, including representing Khamenei for 25 years at the Supreme National Security Council.

When he was swept to office four years ago with three times as many votes as his nearest challenger, Iranians held high hopes that he could fulfill his promises to reduce the country’s isolation abroad and bring more freedoms at home.

As an establishment insider, he was intimately familiar with the policymaking process in Iran, where decisions by the elected government and parliament can be undone by the clerical judiciary that has ultimate say.

He promised to achieve the aims sought by reformists, but without crossing the lines that would provoke a hardline backlash, and heal wounds of the previous presidential election, when mass reformist protests were violently crushed after the disputed the re-election of hardliner Mahmoud Ahmadinejad.

The crowning achievement of Rouhani’s first term was a deal with global powers to curb Iran’s nuclear program in return for the lifting of most financial sanctions. Crucially, Rouhani’s government won the cautious backing of the hardline supreme leader for the deal.

But since the accord was reached, the promised economic benefits have been slow to arrive. Meanwhile, there has been little progress on giving Iranians more freedom at home to gather, communicate and dress as they please.

Many reformist voters say they are disillusioned, an apathy Rouhani’s allies see as the biggest threat to his re-election. His fiery rhetoric in the final days of the campaign seems intended to whip up support from reformists and remind them of the high stakes.

But it also risks provoking the sort of backlash from the hardliners that he previously averted. Khamenei issued a veiled rebuke on Wednesday, calling some of the rhetoric in a televised debate “unworthy”. Although the supreme leader did not single out any candidate, it was easy to read it as aimed at Rouhani.