* Arrest of prosecutor marks stage in Ahmadinejad's decline
* Ahmadinejad at odds with parliament and powerful speaker
* Larijani's star rising while Ahmadinejad's fades
* Pragmatic, powerful rivals may see more flexible diplomacy (Adds detail and analysis)
By Yeganeh Torbati
DUBAI, Feb 5 (Reuters) - The arrest of once-feared Iranian prosecutor Saeed Mortazavi is one more nail in the coffin of the political career of President Mahmoud Ahmadinejad, hammered home by arch-conservatives manoeuvring to take power in elections this year.
Monday's arrest was announced by prosecutors on Tuesday.
Reviled by reformers since the violent suppression of mass protests after his disputed re-election in 2009, Ahmadinejad has become increasingly isolated as Supreme Leader Ayatollah Ali Khamenei, the final arbiter on all matters in Iran, has distanced himself from the populist but less powerful president.
As he prepares to step down at the end of his second term in June, Ahmadinejad's conservative rivals have taken their cue to move in for the kill and could target others among his allies.
While in-fighting may frustrate Western hopes of a deal soon on Iran's nuclear programme, Ahmadinejad's rivals, surer of their power base, may prove more pragmatic than he in diplomacy.
For now, Iran's leaders seemed turned inward ahead of the June election. As in France two centuries before, the Islamic revolution of 1979 has also "devoured its children", with the arrest and elimination of erstwhile allies and the concentration of power in the hands of an ever smaller hard core.
Accused of overseeing the abuse and killing of protesters after the 2009 poll, it is now the turn of Mortazavi, described by Human Rights Watch as a "serial human rights abuser", to share the fate of the hundreds he sent to the notorious Evin prison while Tehran's chief prosecutor between 2003 and 2009.
"The Tehran prosecutor announced on Monday night that Saeed Mortazavi has been arrested," read a one-line statement from the prosecutor's office, giving no reason for the arrest.
Mortazavi's arrest followed closely after Ahmadinejad suffered humiliation on Sunday at the hands of his political nemesis, parliamentary speaker Ali Larijani, as Iran's political infighting made a rare spill onto the public stage.
Facing the impeachment of his labour minister for giving Mortazavi a new job, Ahmadinejad, an austere, self-styled champion of the poor, carried out his long-standing threat to expose corruption among his political enemies, led by the Larijani brothers, the wealthy sons of a respected ayatollah.
THREAT FALLS FLAT
But Ahmadinejad's threat fell flat as the tape he said showed the speaker's brother, Fazel Larijani, offering to help Mortazavi in return for business favours proved inaudible in parliament. When Ahmadinejad later asked to continue to speak, Ali Larijani refused the request and he left the chamber.
Ahmadinejad's opponents pressed home their advantage and had Mortazavi arrested shortly before the president left for a high-profile official visit to Egypt on Tuesday.
"When Ahmadinejad went into parliament and went after the entire Larijani family, key figures in the regime could no longer accept that confrontation," said Scott Lucas, the founder of EA WorldView, a news website that monitors Iranian media.
A Western diplomat based in Tehran said: "Mortazavi's arrest was part of the payback for the president's appearance in parliament."
At the airport, heading for Cairo, Ahmadinejad struck a defiant tone, but could do little but promise to investigate the case on his return: "The judiciary is not a special family organisation," he said, according to the state news agency IRNA.
Iran's judiciary is headed by another of the speaker's brothers, Sadeq Larijani.
"I don't know how it has happened that one person has committed an infraction, and another person is arrested," Ahmadinejad said. "Instead of going after the violator, they go after the person who has announced the violation.
"This is very ugly."
CIRCLED BY ENEMIES
Ahmadinejad is increasingly circled by enemies looking to erase all vestiges of his legacy from Iran's power structure, analysts say, suggesting more of his allies might get picked off ahead of the presidential election in June.
But Khamenei's order for parliament in November to call off plans to question Ahmadinejad over economic mismanagement and the plummeting currency was seen as a signal that the president should be allowed to serve out his second and final term.
With Western sanctions imposed over Iran's disputed nuclear programme biting ever harder, Ahmadinejad's rivals may also hope the president will prove a useful lightning rod for discontent over spiralling inflation and widespread unemployment.
"As long as Ahmadinejad is there his government can be blamed for the economic difficulties that Iran finds itself in. That's why he's never going to be impeached," said Lucas.
Even though Iran is to hold a further round of nuclear talks with six world powers in Kazakhstan on Feb. 26, it is doubtful whether Ahmadinejad's government has the backing of Khamenei necessary to conclude a deal.
Khamenei ordered a three-man committee of loyalists last week to choose a "unity" candidate for the presidency from the factions close to the leader.
Ali Larijani could well emerge as that candidate and, officially anointed by the leader, would stand a more than fair chance of being elected the president.
The reformist faction that held the presidency before Ahmadinejad has been silenced and his challengers in the 2009 elections, remain under house arrest.
Larijani himself is yet to be drawn on his plans for the election, but analysts agree he is poised to join the race.
"Larijani is extremely vain and not a little opportunistic," aid Ali Ansari of Scotland's St Andrew's University. "The chance of becoming president, even in this pantomime, will I suspect be sufficiently tempting for him to take part."
Crucially, Larijani and his brothers never miss an opportunity to show unwavering loyalty to the leader.
"The Larijani brothers were shrewd enough to understand that power in today's Iran is a function of one's proximity to the Supreme Leader," said Karim Sadjadpour, an associate at the Carnegie Endowment for International Peace.
A Europe-based Iranian who has met the statesman on several occasions said he made speeches simply to satisfy the leader.
"He comes out with harsh rhetoric against the West, but they know the Larijani family is not negative at all about the West. It is a joke among many Iranians," said the Iranian source.
To those who know him, the speaker of parliament comes across as contemplative, pragmatic and a coherent strategist.
With sanctions cutting deep into Iran's economy, the prospect of a steady hand may attract Iran's leadership.
"Larijani is a realist, compared to Ahmadinejad," said the Iranian source. "For instance, he would stand a better chance of reaching a nuclear deal. He would be able to handle relations with the West much better." (Writing by Jon Hemming; Editing by Alastair Macdonald)