Iran's President Mahmoud Ahmadinejad and Saudi Arabia's King Abdullah have agreed to work together to fight sectarian strife in the Middle East.
The pair are leading representatives of Islam's Shia and Sunni branches
The announcement followed a visit by Mr Ahmadinejad to Riyadh for rare talks.
Speaking on his return to Tehran, he said the two countries would stand together against "enemy plots" seeking to divide the Muslim world.
The summit comes at a time of sectarian division and tension between Saudis and Iran over events in Iraq and Lebanon.
Saudi Arabia, a major Sunni power in the region, and Iran, an important Shia power, have found themselves aligned with groups on opposing political sides.
Correspondents say Saudi Arabia has led a diplomatic drive in recent months to counterbalance what it sees as Iran's growing influence in Iraq, Lebanon and the Palestinian territories.
An account of the talks was issued by the official Saudi Press Agency early on Sunday, shortly after Mr Ahmadinejad left Riyadh to return home to Tehran.
"The two leaders asserted that the greatest danger threatening the Muslim nation at the present time is the attempt to spread strife between Sunni and Shia Muslims and that efforts should be exerted to stop such attempts and close ranks," it said.
The agency quoted Mr Ahmadinejad as saying he supported Saudi attempts to calm the situation in Lebanon and resolve the political crisis there.
There has been a recent flurry of contacts between Saudi Arabia, which is influential with Lebanon's Sunnis, and Iran, which backs Hezbollah and is also allied to Syria.
The two leaders also reportedly stressed the importance of Palestinian unity and the need to safeguard Iraq's independence and integrity.
Speaking in Tehran after the talks, Mr Ahmadinejad said: "We discussed the Palestinian and Iraq issues comprehensively. We have common views in this regard."
He also said that "plots carried out by the enemies in order to divide the world of Islam were discussed" and that the Saudis had joined Iran in condemning them, the AFP news agency reports.
"Iran and Saudi Arabia oppose the dominance of enemies over the region and their conspiracies. During this trip, we tried to devise some measures to prevent the enemies from harming the Muslim world and to foil their plots," Mr Ahmadinejad said.
Mr Ahmadinejad said he supported Saudi efforts to calm Lebanon
Mr Ahmadinejad's trip to Riyadh came as Iran is under growing pressure from the West over its refusal to halt its uranium enrichment programme.
The US has also claimed that the "highest levels" of Iran's government are supplying arms used by Shia militants in Iraq.
Iran is a rising power bolstered by the removal by the US of its two great enemies - the Taleban in Afghanistan and Saddam Hussein's regime in Iraq - the BBC's diplomatic correspondent Jonathan Marcus says.
Iran's Shia allies are now the dominant force in Iraq, while Tehran's influence is spreading more widely into Lebanon and the Palestinian territories.
Sunni-ruled states like Jordan and Saudi Arabia are watching Iran's rise with a degree of anxiety, our correspondent adds.
It makes sense for the Saudis and the Iranians to talk as neither country has an interest in a Sunni-Shia rivalry in the region getting out of control, our correspondent says.
Indeed, the fact that this bilateral meeting has come ahead of a wider multilateral gathering on Iraq suggests that some sort of new understanding just might be in the works, he says.