Iranian President Mahmoud Ahmadinejad and King Abdullah also stressed the importance of maintaining Palestinian unity and bringing security to Iraq, the official Saudi Press Agency said.
The agency quoted Ahamdinejad as saying he supported Saudi efforts to calm the situation in Lebanon and end its political crisis. Iran supports Lebanon's Shiite Hezbollah group, which is trying to topple the U.S.- and Saudi-backed government.
The talks between the two leaders have been touted as a possible means to defuse sectarian tensions in Iraq and Lebanon, and prevent Iran from sliding further into isolation.
"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 Shiite Muslims and that efforts should be exerted to stop such attempts and close ranks," the Saudi Press Agency said.
Iran and Saudi Arabia have had chilly relations since the 2005 election of Ahmadinejad, whose refusal to suspend uranium enrichment has led to U.N. Security Council sanctions and made Iran's Arab neighbors increasingly wary of the country's nuclear program.
But Abdullah personally met Ahmadinejad at the airport before the two headed into a meeting. The king later threw a banquet in his guest's honor, the Saudi Press Agency said. The Iranian leader left Riyadh late Saturday after the talks.
Saudi and Iranian analysts said cooperation will benefit both countries, as well as the whole region. Shiite-majority Iran and Sunni-dominated Saudi Arabia are on different sides of the two conflicts that are threatening to ignite the Middle East - Iraq and Lebanon - and the Saudis have expressed concerns over Iran's nuclear program.
Dawood al-Shirian, a Saudi analyst, said the kingdom would not have agreed to receive Ahmadinejad "if it didn't know that the visit would add to its political achievements."
Top diplomats from the United States, Russia, China, Britain, France and Germany were negotiating Saturday on possible new sanctions against Iran. None of the governments commented immediately after the conference call. A breakthrough on the Muslim sectarian divide could also pave way for the success of the March 10 conference in Baghdad of Iraq's neighbors - Iran, Syria and Saudi Arabia - as well as the United States and other Western powers, and the annual Arab summit, which will be held at the end of the month in Riyadh. "Iran has proved its capability of destabilization," wrote Ghassan Sharbil, the Lebanese editor of the Saudi-owned Al-Hayat daily. "Now, it's time to prove its ability to participate in creating stability." "Ahmadinejad can invest in this summit to calm down the Arab world, the Islamic world and the whole globe in order to protect Iran against isolation, the dangers of an American strike and a new resolution by the Security Council," he added. 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 again following Ahmadinejad's election in 2005. Since then, Arab Gulf countries have offered quiet support for moves against Iran's nuclear program that the United States and its allies fear is aimed at creating weapons. Iran says its program 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.