UN secretary-general Ban Ki-moon said he made the late invitation to the talks in Switzerland from Wednesday after Tehran pledged to play a "positive and constructive role" in efforts to end Syria's worsening three-year civil war.
But the Syrian National Coalition promptly said it would withdraw from the negotiations unless the invitation to Iran - a key backer of Syrian President Bashar al-Assad - was retracted.
And the United States also weighed in, urging Iran to back calls for a transitional government in Syria or lose the invitation.
If Iran does go, there will be 40 countries and a group of regional bodies at the opening meeting, which will be the most intensive diplomatic effort yet to end a war that the UN says has left well over 100,000 dead.
Talks between Assad's government and the opposition are due to start in Geneva on Friday.
Ban told a news conference he extended a late invitation to Tehran after intense talks over two days with Iranian Foreign Minister Mohammad Javad Zarif.
"Foreign Minister Zarif and I agree that the goal of the negotiations is to establish, by mutual consent, a transitional governing body with full executive powers," Ban told reporters.
"He assured me again and again that Iran, if they are invited, then they will play a very positive and constructive role," the UN secretary-general added.
But Louay Safi, spokesman for the Syrian National Coalition, which only decided on Saturday to attend the conference, announced on the group's Twitter account that the opposition would withdraw "unless Ban Ki-moon retracts Iran's invitation".
The threat came only hours after international leaders had hailed the coalition's decision to take part in negotiations.
The United States and other Western powers had opposed Iran's attendance at the meeting as long as it refused to accept a communique adopted by the major powers in Geneva on June 30, 2012, calling for a transitional government in Syria.
Washington made a new call for a clear signal from Tehran, a financial and military supporter of Assad, that it back efforts to set up a transitional government.