Saudi King Abdullah and Iranian President Mahmoud Ahmadinejad, heavyweights of Sunni and Shi'ite Muslims respectively, have agreed to fight the spread of sectarian violence in the Middle East.
On returning to Iran, President Ahmadinejad described his trip to Saudi Arabia as fruitful.
The two leaders discussed the importance of Palestinian Unity and the need to safeguard Iraq's independence and unity.
Both countries will be among those attending a conference on Iraq in Baghdad later this month.
Saudi and Iranian officials have also been mediating between Lebanon's Hezbollah-led opposition and the U.S. and Saudi-backed government.