Iran warned Saudi Arabia to stop working against it on Wednesday as their diplomatic crisis intensified despite efforts to defuse a row that has raised fears of regional instability.

In the latest salvo in a dispute that has seen Saudi Arabia and some of its Arab allies cut ties with Tehran, Foreign Minister Mohammad Javad Zarif said Riyadh must end its prolonged efforts to confront Iran.

"For the past two-and-a-half years, Saudi Arabia has opposed Iran's diplomacy," Zarif said at a joint press conference in Tehran with Iraqi Foreign Minister Ibrahim al-Jaafari.

"Saudi Arabia has moved against our efforts and, unfortunately, they opposed the nuclear agreement," Zarif said.

"This trend of creating tension must stop. We need to stand united... and stop those who are adding fuel to the fire."

The spike in tensions comes after Iran last year secured a historic nuclear deal with world powers led by the US, causing major concern in longtime US ally Riyadh.

The row between Saudi Arabia and Iran erupted following Riyadh's execution on Saturday of prominent Shia cleric Nimr al-Nimr.

His death sparked demonstrations in many countries including Iran, where protesters stormed and set fire to the Saudi embassy in Tehran and the kingdom's consulate in second city Mashhad.

Riyadh cut ties with Tehran in response and was joined by several of its Arab allies including Bahrain and Sudan. The United Arab Emirates also downgraded relations with Iran and Kuwait recalled its ambassador.

The row has raised fears of an increase in sectarian tensions in the Middle East that could derail efforts to resolve pressing issues including the wars in Syria and Yemen.

Kerry in bid for calm  

The UN and Western governments have expressed deep concern, urging both sides to reduce tensions.

US Secretary of State John Kerry has made repeated calls to both Iranian and Saudi leaders.

"He is urging calm. He is stressing the need for dialogue and engagement, and thirdly, reminding that, again, there's lots of work to be done in the region," State Department spokesman John Kirby told reporters in Washington on Tuesday.

"It's important to work though that tension, work though those disagreements, so that we can all work harder together on other issues which are affecting the Middle East writ large," he said.

Cooperation between Saudi Arabia and Iran is crucial in resolving a range of issues in the Middle East, where they are often on opposing sides.

In Syria, Iran is supporting the government of President Bashar al-Assad against rebel groups, some backed by Saudi Arabia.

In Yemen, Riyadh is leading a military intervention against Iran-backed Shia rebels who have seized control of large parts of the country.

UN Secretary General Ban Ki-moon has also been in touch with Saudi and Iranian leaders to urge calm, and the Security Council has condemned the attack on Riyadh's diplomatic missions.

On Tuesday, Iran's President Hassan Rouhani accused Saudi Arabia of focusing attention on the incident to "cover its crime" of executing Nimr.

Iran 'never sought tension'

"We have never sought to create tension. We have always adopted a policy of interaction and dialogue," Zarif said, reiterating that the violent scenes at the embassy were "not justified".

"All Iranian officials condemn it," he added.

This week has seen several sectarian attacks in Iraq as the row escalated, including the bombings of two Sunni mosques, raising fears the country could plunge back into all-out civil conflict.

"Some people want to create the spark that will reignite war among Iraqis and we must stop them because such acts only serve the enemies of Iraq," said Mohammed Abdelfattah, a Sunni cleric from the Iraqi town of Hilla where several attacks have taken place.

Iraq has close ties with Tehran.

Jaafari, who was to hold talks later with Rouhani, said Iraq was seeking a potential diplomatic role to help resolve the crisis and echoed the concerns about sectarianism.

"I have spoken to the foreign ministers of some of the Arab countries to reduce the consequences of this issue and prevent enemies from dragging the region into a war that can have no winners," Jaafari said.

Media reports said his counterpart from Oman, which has often played a mediating role in the region, was also expected in the Iranian capital on Wednesday.

Oman's foreign ministry on Wednesday expressed its "deep regret" over the embassy attack but the country did not announce any measures against Iran.