By Louis Charbonneau and Michelle Nichols
UNITED NATIONS (Reuters) - What was supposed to be one of the biggest diplomatic coups of Ban Ki-moon's two terms as United Nations Secretary-General was nearly his worst disaster.
A year in the making, an international peace conference aimed at ending Syria's civil war, which has killed well over 100,000 people, was almost undone in less than 24 hours by Ban.
With prospects of the so-called Geneva-2 talks bringing peace to Syria appearing dim, on Sunday Ban invited the most controversial potential participant - Iran, Syrian President Bashar al-Assad's staunch ally and military supplier.
A chaotic day later, with talks on the edge of collapse, before they had even begun, Ban rescinded the invitation.
Diplomats say the U.N. chief believed he had a commitment from Iran to agree to the West's terms for talks - but he didn't. The diplomats are still debating whether Ban misunderstood Iran or was misled, and why he made the hasty invitation in the face of clear skepticism from Washington.
There were some signs of difficulty from the beginning - the U.N. chose to hold the Geneva talks on January 22 - when an annual watchmakers convention would be taking over much of the Swiss city - so the opening events of the Geneva-2 conference had to be moved 93 km (58 miles) away to the Alpine city of Montreux.
At the same time, the potential guest list was becoming crowded - with the wrong people.
"We had countries that have nothing to do with the Syrian conflict begging us to attend," a diplomatic source told Reuters on condition of anonymity.
"Whether Geneva succeeds or not is almost secondary to who's invited and who's not invited," a senior U.N. Security Council diplomat said last week.
By late last week, the United States, Russia, Assad's government and the main Syrian political opposition were all ready to attend, but the question of Iran was still not resolved - the United Nations had long insisted that Tehran should attend because of its importance for the region and the Syria conflict, a view supported by Russia.
Then Ban's press office convened a news conference on Sunday evening, with just over an hour's notice, and announced that he had decided to invite the Islamic Republic.
Ban thought he had received assurances from Iran that it had reversed course and now supported a June 2012 plan for the creation of a transitional government for Syria.
Washington had consistently said Iran must first embrace the June 2012 plan for a political transition - the so-called Geneva communique - if it was to come to Geneva-2. It repeated that position to the United Nations after Ban told the United States on Sunday that it planned to invite Iran.
"We were very clear both publicly and privately with the U.N. from Secretary (of State John) Kerry and Ambassador (to the United Nations Samantha) Power on down that in order for Iran to attend they needed to publicly endorse the Geneva 1 communique," State Department spokeswoman Marie Harf told reporters in a conference call on Tuesday.
And Ban was confident he had Iran on board, his spokesman said. After speaking with Iranian Foreign Minister Mohammad Javad Zarif and other senior Iranian officials, Ban assumed that Iran was now ready to accept the 2012 Geneva communique - thereby removing the main obstacle to its attending Geneva-2.
U.N. spokesman Martin Nesirky said Zarif and other Iranian officials told Ban that "Iran understood and supported the basis and goal of the conference, including the Geneva communique."
But after Ban's announcement, Tehran disagreed. According to one Iranian source, Zarif never told Ban that Tehran would accept the Geneva communique but used typically vague diplomatic language, "which might be the source of the misunderstanding."
A spokesman for Iran's U.N. mission reiterated the point on Tuesday: "There was no change in the (Iranian) positions."
Several diplomats said that Ban appeared to misinterpret his conversations with the Iranians and became convinced that Tehran had reversed course in the interest of attending Geneva-2.
Some noted that Iran's agreement to the terms for a transitional government would have been a major diplomatic coup for Ban.
"(Ban) heard what he wanted to hear and I think he acted on the basis of an agreement he believed he obtained," a U.N. diplomat said. "The stakes are huge, the payoff is also potentially huge. He clearly thought he had a deal, which it turns out he didn't have."
Another diplomat said Ban had gotten it wrong.
"Ban probably misjudged the assurances he got from the Iranians," the diplomat said. "He thought he had absolutely cast-iron assurances and so he felt confident going out and saying what he did on Sunday and then either he misjudged that or - surprise, surprise - the Iranians are a sneaky bunch and on Monday didn't say what he thought they would."
'A REAL MESS'
As a result of Ban's announcement on Sunday, the Syrian opposition threatened to pull out of the Geneva-2 talks, which would have caused the collapse of the conference. The opposition Syrian National Coalition put some of the blame on the Americans.
"The Americans knew all about it," said Badr Jamous, Secretary General of the opposition coalition. "The Americans and the U.N. rang us about two hours before the invitation was issued and we warned them again, then, that we won't come if Iran is invited."
Washington did know about Ban's decision on Sunday but made clear it did not like it and passed on the opposition's threat to pull out. Both Kerry and Power called Ban on Sunday to express their concern about the invitation for Iran.
But Ban decided to go ahead with the announcement.
"The understanding from our side was the U.S. had some problems with this but they're willing to let (Ban) make the call," the U.N. official said. "Their point was, 'well this is your call to make because you're the convener.'"
After the opposition issued its angry reaction, the State Department quickly sent out a statement urging Ban to withdraw Iran's invitation unless it explicitly and publicly endorsed the 2012 Geneva communique.
France and Britain echoed the U.S. statement. Ban found himself under intense pressure to withdraw the invitation - especially after Iran's U.N. Ambassador Mohammad Khazaee openly declared that Tehran rejected the Geneva communique.
"If the participation of Iran is conditioned to accept Geneva I communique, Iran will not participate in Geneva II conference," Khazaee said.
The United Nations was scrambling. Ban and two of his top advisers - chief-of-staff Susana Malcorra and U.N. political affairs chief Jeffrey Feltman - worked the phones to salvage the peace conference.
"It was a real mess throughout the day and various scenarios were being discussed," a Western diplomat said. "At one point there was even talk of rescinding all invitations except for Russia and the U.S. to let them sort it out."
With Ban due to depart for Switzerland, he instructed his spokesman to summon the press on Monday afternoon and read out a statement announcing the withdrawal of Iran's invitation so that the Geneva-2 conference could go ahead as planned.
"Obviously things turned out worse than we had calculated," the U.N. official said.
(Additional reporting by John Irish, Parisa Hafezi, Tom Miles and Dasha Afanasieva; Editing by Peter Henderson and Grant McCool)