TEHRAN (Reuters) - Moderate former president Mohammad Khatami withdrew from Iran's presidential election on Monday, allies said, a move analysts say may boost President Mahmoud Ahmadinejad's re-election chances.

He has decided to withdraw ... but he will back another moderate candidate who will be announced shortly in a statement by Khatami, one close ally, who declined to be named, told Reuters.

The outcome of the June election could influence Iran's approach in its row with the West over its nuclear program, even though Supreme Leader Ayatollah Ali Khamenei has the final say on such issues.

Another ally said Khatami pulled out from the race because of his desire to unite the reformist front against Ahmadinejad, a conservative politician who often rails against the West.

For the sake of the reformist front ... and to avoid splitting the vote, Khatami withdrew, said the other ally, who also asked not to be named before the statement was published.

Khatami's aides did not name the politician who Khatami would back but the former president had a meeting with another moderate candidate, former prime minister Mirhossein Mousavi, on Sunday.

Mousavi's office said Khatami backed Mousavi's candidacy and his withdrawal was aimed at not depriving Mousavi of much-needed votes.

Khatami, who served from 1997 to 2005, oversaw a thaw in Iran's ties with the West. Those relations have since sharply deteriorated under Ahmadinejad, who is expected to seek a second four-year term in the June 12 vote.

'REFORMERS WILL LOSE'

Analysts had seen Khatami as Ahmadinejad's main pro-reform challenger.

Khatami wanted to prevent splitting reformists' votes. But his decision will boost Ahmadinejad's chances to win, said political analyst and university teacher Hossein Mirshokuhi.

The reformists will lose. Mousavi and Khatami have different social bases. Supporters of Khatami will not necessarily vote for Mousavi, he said.

Saeed Laylaz, editor of the Sarmayeh business daily, said many Iranians did not regard Mousavi as a reformist: Those who wanted to vote for a reformist candidate will not vote for Mousavi.

Mousavi, prime minister during the 1980-88 Iran-Iraq war, and reformer and former parliament speaker Mehdi Karoubi, have both announced they will run. Ahmadinejad is so far the only leading conservative to let it be known that he will stand.

Ahmadinejad's critics say his fiery speeches against the West have exacerbated a dispute over Iran's nuclear program, which the United States suspects has military aims, a charge Tehran denies.

They also accuse him of poor economic policies blamed for fuelling inflation and squandering windfall oil earnings.

Khatami worked for political and social liberalization during his time in office, but the hardliners in charge of key levers of power blocked many of his reforms.

Analysts have said the fate of the race could depend on whether Ahmadinejad retains the support of Khamenei, whose words could influence millions of loyalists.

Khamenei, who would also decide on any move to renew ties with the United States, has publicly praised Ahmadinejad.

(Editing by Samia Nakhoul)