Iran hit back Tuesday at demands from Saudi Arabia that Tehran withdraw its "occupying" forces from Syria and insisted no country was more committed to confronting jihadists in the region.
The two regional powers have been at odds over Syria since unrest broke out in 2011, but the unusually high-profile exchange threatens to undermine a recent diplomatic push to patch up their differences.
Responding to Saudi Foreign Minister Prince Saud al-Faisal's comments that Iran was "part of the problem, not the solution" in Syria, Tehran rejected the claim.
"The Islamic Republic of Iran is the most important country in the region committed to the fight against terrorism," Deputy Foreign Minister Hossein Amir-Abdollahian was quoted as saying on the website of state television.
"Iran has helped the governments of Iraq and Syria fight against terrorism within the framework of international law."
Iran supports Syrian President Bashar al-Assad with financial and military aid, while Saudi Arabia has backed armed rebels trying to overthrow him.
The threat to Iran and Saudi from Islamic State (IS) jihadists prompted them to try to improve relations this summer but the angry exchange of the past 24 hours on Syria laid bare their differences.
"We recommend that Saudi Arabia pay attention to the plots of the enemies of the region... and play a positive role," Amir-Abdollahian said, without elaborating.
Iran denies having fighters on the ground in Syria. Assad, however, is backed by fighters from Lebanon's pro-Iranian Shiite movement Hezbollah.
Iran has accused Saudi Arabia and other Gulf countries of aiding the jihadists' initial rise in Syria.
However, Saudi and four other Arab nations are now taking part in or giving support to air strikes by the US-led coalition against IS militants in Syria.
The Iranian and Saudi foreign ministers met in New York before the UN General Assembly last month to agree on what was billed as "a new page in relations between the two countries."
The encounter was the first between the top diplomats since Iranian President Hassan Rouhani came to power in August 2013.
However, Prince Saud on Monday hit out at Tehran, saying that "in many conflicts, Iran is part of the problem, not the solution."
"In this case, we can say that Iranian forces in Syria are occupying forces," he said.
"If Iran wants to be part of the solution in Syria, it has to pull its forces from Syria. The same applies elsewhere, whether in Yemen or Iraq."
Iran is accused of backing Shiite rebels in Yemen who overran the capital Sanaa on September 21 and of supporting the Shiite-led government in Iraq.