TEHRAN — Iran on Wednesday accepted an invitation to attend a broad new round of negotiations to resolve the Syrian war, sitting with longtime adversaries including the United States and Saudi Arabia who once sought to bar the Iranians from any role in Syria’s future.

The inclusion of Iran in the talks represented the first time that the United States has chosen to formally engage the Iranians diplomatically on the Syria issue. It also came a little more than three months after Iran signed a historic nuclear accord with the United States and other powers that promised to end Iran’s economic isolation in return for limits on its nuclear enrichment, suggesting an effort to broaden the discussion beyond that successful negotiation.

Iran’s acceptance of the invitation to join the Syria talks in Vienna, an offer made by Russia after President Obama and Secretary of State John Kerry dropped Washington’s past objections, reflected how rapidly the dynamics of the war have changed. Clearly worried about the military support that Russia and Iran are providing to prop up President Bashar al-Assad, the United States has concluded that the only hope for easing Mr. Assad from power is to find a political solution with his two sponsors.

But Iran’s participation also appeared to signal how Iran is emerging from decades of American-imposed marginalization. Only two years ago, it was disinvited from joining Syrian peace talks because of pressure from the United States. Now, with Iran’s enhanced standing in the aftermath of the nuclear agreement, Mr. Kerry appears to be testing whether a broader basis for cooperation is possible.