Riyadh: Saudi Arabia and Iran agreed to fight the spread of sectarian strife that threatens to spill over from their neighbour Iraq, the Saudi foreign minister said.

Saudi King Abdullah held talks on Saturday with Iranian President Mahmoud Ahmadinejad who was on his first official trip to Saudi Arabia. A Saudi official said earlier the kingdom would seek Iran's help to ease sectarian tensions in Iraq erupting into full-blown civil war.

Killings by Sunni and Shiite death squads in Iraq and the political crisis in Lebanon dividing Sunni and Shi'ite parties have led to fears of sectarian conflict in the Middle East. Sunni Saudi Arabia and Shi'ite Iran are among the most influential nations of their respective branches of Islam.

"The two parties have agreed to stop any attempt aimed at spreading sectarian strife in the region," Saudi Foreign Minister Prince Saud Al Faisal told reporters.

"The two leaders stressed that the greatest threat against the Muslim nation are attempts to spread strife between Sunni and Shiite Muslims," the official Saudi agency SPA said.

Ahmadinejad and King Abdullah also voiced support for Iraq's government, its national unity and the "equality of its citizens".

Ahmadinejad voiced support for Saudi efforts to ease tensions in Lebanon, and the two leaders called on all parts to cooperate with these efforts, the agency said.

The two leaders also stressed the importance of Palestinian unity and the need to implement the security plan of the Iraqi government and safeguard Iraq's independence and unity, according to SPA.

Iranian President Mahmoud Ahmadinejad left Riyadh late Saturday following the talks with King Abdullah.

Saudi and Iranian analysts said cooperation between the two giants will benefit both countries, as well as thewhole region.

Riyadh broke off ties with Iran in 1988, accusing it of supporting terrorism and subversion. They were restored
shortly after the 1991 Gulf War, but relations between Iran and Saudi Arabia plummeted since Ahmadinejad's election in 2005.

Since then, Arab Gulf countries have offered quiet support for moves against Iran's nuclear programme that the United
States and its allies fear is aimed at creating weapons. Iran says its programme is solely for peaceful purposes.

The chill in relations is partly due to Ahmadinejad's tough anti-Western talk, which has raised suspicions among
Sunnis that Tehran is trying to expand its influence in the
region.

"Since Ahmadinejad's harsh rhetoric is partly responsible for the cooling in relations, he is (now) taking this step
to redress (the situation)," said independent Iranian writer Saeed Leylaz.