In the highest level talks since Mogherini visited Tehran in July in the wake of the historic Iran nuclear deal, she and Iranian Deputy Foreign Minister Hossein Amir-Abdollahian met for three hours, followed by talks between senior officials.
"There was an agreement that only a political track, that involves all parties, can ensure a stable solution to the conflict in Syria and to this end a joint effort of all the relevant regional and international actors is required," the statement issued by the EU said.
"The dire humanitarian situation was also highlighted," it said of a conflict which has cost some 250,000 lives and displaced 12 million people, half the Syrian population.
Iran supports Syrian President Bashar al-Assad against western-backed rebels seeking to depose him.
Mogherini and EU foreign ministers reiterated Monday that Assad should have no role in a future Syria but called for an "inclusive transition" process to a new government which could involve representatives of the government.
Some EU member states believe it is inevitable that Assad plays some interim role but others such as Britain and France are staunchly opposed.
The statement made no mention of the international accord with Iran on its contested nuclear programme which Mogherini helped negotiate earlier this year and its formal passage Tuesday through parliament in Tehran.
Mogherini tweeted separately: "Good news from Tehran today: parliamentary process of the nuclear deal completed, getting closer to formal adoption;" AFP reported.