WASHINGTON - U.S. President Barack Obama plans to pursue attempts to engage Tehran whether hard-line President Mahmoud Ahmadinejad or his moderate rival Mirhossein Mousavi ultimately emerges as the winner of Iran's election.

The president's decision to engage Iran was not based on a particular electoral result. We are going to engage the Iranian government whether it is led by one faction or the other, a senior State Department official said.

State media declared Ahmadinejad the winner but challenger Mirhossein Mousavi alleged irregularities and claimed victory for himself after the hotly contested election.

Washington hoped that, whoever wins, the election will end the acerbic tone from Iran and reduce tension as major powers seek to curb Tehran's nuclear ambitions.

Experts said a second term by Ahmadinejad would make it tougher for Obama to change the tone but they also cautioned against excessive optimism if former prime minister Mousavi wins.

This is going to be hard and complex, regardless of who is elected president. There are a lot of different factions and mixed views on the idea of engaging the Great Satan (as Iran has sometimes called Washington), added the State Department official. He was speaking on condition of anonymity before the results were known.

UNKNOWN QUANTITY

Ex-CIA analyst Bruce Riedel said Ahmadinejad's re-election could cripple U.S. efforts to improve relations. But he also said Mousavi's rule as prime minister in the 1980s had been a scary time.

During that period the Iranian-backed Lebanese militant group Hezbollah, which is also a political movement, was formed and the former prime minister took a hard line against Israel.

We don't know whether that is Mousavi any more. Is he still that Iranian or has he changed? I think clearly, Iranians think -- at least the reformers -- that he is a different person. I am not saying he is or he isn't but he would be more of an unknown quantity, said Riedel.

But if you have to choose between the two, we are much better off with change than with another four years of Ahmadinejad, added Riedel, who is now an analyst with the Brookings Institution's Saban Center.

The United States hopes the election will end months of stalling by Tehran both over how to respond to Obama's personal overtures as well as an offer by major powers, including Washington, to settle disputes over its nuclear program.

INTERNATIONAL RESOLVE

Mousavi has pledged to continue nuclear talks with major powers if he is president, while Ahmadinejad has ruled out such negotiations with the United States, Russia, China, France, Germany and Britain.

Another Ahmadinejad term would probably make it easier for Washington to push for more intense sanctions against Iran if it continues to resist giving up uranium enrichment the West suspects is aimed at building an atomic bomb. Tehran argues that its nuclear program is peaceful.

A Mousavi win will make it tougher for Washington to maintain international resolve over Iran's nuclear program, particularly from China and Russia which have consistently balked at tough financial pressure.

Russia and China do not have any resolve and will use it as an excuse, said Elliott Abrams, a former senior Bush administration official now with the Council on Foreign Relations.

But Middle East expert Jon Alterman said it was advisable for any new government to wait a while before acting and that the Obama administration must continue pushing even for a limited dialogue with the goal of better managing tensions between the two.

Whatever the results, Iran is in a state of political ferment. There is a sense that if the facts have not changed, the mood has changed, said Alterman.

Regardless of who wins, the policy should be a quiet exploration of ways to build common interest and ways to stop offensive behavior, he said.

(Edited by David Storey)