CAIRO (AP) -- Iranian President Mahmoud Ahmadinejad discussed the crisis in Syria with his Egyptian counterpart Tuesday in the first visit by an Iranian leader to Cairo in more than three decades, marking a historic departure from years of frigid ties between the regional heavyweights.
Ahmadinejad's three-day visit, which is centered around an Islamic summit, is the latest sign of efforts by Egypt's Islamist President Mohammed Morsi to improve relations, which have been cut since Iran's 1979 revolution.
Morsi's flirtation with Iran is seen as aiming to strike an independent foreign policy and broaden Egypt's connections after the ouster two years ago of longtime leader Hosni Mubarak, who kept close to the line of the United States. Such a visit by an Iranian leader would have been unthinkable under Mubarak, who was a close ally of the U.S. and shared Washington's deep suspicions of Tehran.
But the limits to how far Morsi can go were on display during Tuesday's visit. There are deep suspicions in overwhelmingly Sunni Muslim Egypt toward Iran and its Shiite clergy leadership. Also, Morsi's government was quick to reassure Arab Gulf nations, which are bitter rivals of Tehran and are concerned over the spread of its influence, that Egypt is intent on their security.
Sunni-Shiite tensions dominated talks Ahmadinejad held with Egypt's most prominent cleric, Sheik Ahmed el-Tayeb, who heads the Sunni world's most prestigious religious institution, Al-Azhar.
El-Tayeb upbraided Ahmedinejad on a string of issues. He warned against Iranian interference in Gulf nations, particularly Bahrain, where the ruling Sunni minority has faced protests by the Shiite majority. He also said attempts to spread Shiite Islam in mainly Sunni Arab nations were unacceptable and demanded a halt to bloodshed in Syria, where Tehran's ally President Bashar Assad has been battling rebels, according to a statement by Al-Azhar about the meeting.
He also demanded Ahmedinejad come out against insults against the first caliphs who succeeded the Prophet Muhammad and other figures close to the prophet in the 7th Century. Those figures are widely resented among Shiites because they are seen as having pushed aside Ali, the prophet's son-in-law who Shiites consider his rightful successor. The dispute over succession is at the root of the centuries-old split between Islam's Shiite and Sunni sects.
The meeting was "tense," acknowledged an aide to the sheik, Hussein al-Shafie, at a press conference with Ahmadinejad afterward - which el-Tayeb did not join.
Morsi gave the Iranian leader a red-carpet welcome on the tarmac at Cairo airport, shaking his hand and exchanging a kiss on each cheek as a military honor guard stood at attention.
The two leaders then sat down for a 20-minute talk that focused on the civil war in Syria, security officials said on condition of anonymity because they were not authorized to brief the media. Iran is Damascus' closes regional ally, while Egypt is among those that have called on Assad to step down.
In September, Morsi offered a package of incentives to Tehran to end its support for Assad. The proposal included the restoration of full diplomatic ties, which would be a significant prize for Iran given that Egypt is the most populous Arab nation and a regional Sunni powerhouse.
Morsi's offer garnered no response from Iran, although officials from both countries have continued to hold talks on the Syrian conflict in recent months.
Such diplomatic overtures have raised concerns among Sunni Gulf nations, who are keeping a close eye on the Iranian leader's visit. The Gulf states, who are opposed to Iran's regional policies, accuse Iran of supporting Shiite minorities in the Gulf, and harbor concerns about Tehran's disputed nuclear program.
Morsi and the fundamentalist Muslim Brotherhood group from which he hails have sought to ease Gulf concerns about its improved ties with Iran, and have stressed that the security of the Gulf nations - which Egypt has relied upon for financial aid to help prop up its faltering economy - is directly linked to Cairo's own.
Foreign Minister Mohammed Amr Kamel reiterated that on Tuesday, saying "Egypt's relationship with Iran will never come at the expense of Gulf nations."
Egypt was once closely allied to Iran's former ruling shah. The two countries severed relations after the 1979 Islamic Revolution brought a clerical rule to power in Iran and Egypt offered refuge to the deposed shah. In fact, Ahmadinejad's visit to Al-Azhar's sheik brought him not far from a grandiose Cairo mosque where the shah - despised by Iran's clerical rulers - is buried.
Relations further deteriorated after Egypt's peace treaty with Israel.
Morsi's government has presented the moves to improve ties as a policy of greater independence from the United States. He may also have geopolitical considerations: Gulf powerhouses Saudi Arabia and the United Arab Emirates are cool to Morsi's Muslim Brotherhood and his rule, and several experts said Morsi wants to keep the option of ties with Iran open as an alternative.
"Now relations with Gulf Countries are not that good. You need to make some balance and to play with all cards you have," Egypt's former ambassador to Syria, Mahmoud Shukri, told The Associated Press.
Still, he and others said they don't expect normal relations to be restored between the two countries. "This phase is to open channels and have dialogue," Shukri said.
Morsi is also reluctant to go too far with Iran and alienate the United States, whose help Egypt is hoping for in rescuing a faltering economy, or hurt ties with Israel, with which his government has maintained cooperation despite the Brotherhood's deep enmity to the Jewish state.
"I don't see that Egypt will make a decision separate from the course of its relationship with the U.S. and Israel, for whom Iran is now the main issue," said Mohammed Abbas Nagi, an Egyptian expert on Iran.
The Syria issue is also a complication between Morsi and Tehran. While Iran staunchly backs Assad's bloody suppression of the revolt, Cairo is home to the offices of the main Syrian opposition council, in which the Brotherhood's Syrian branch has a strong presence.
At home, ultraconservative Islamists known as Salafis, who are largely backers of Morsi, see Iran as Sunni Islam's greatest enemy. Salafi clerics often rail against Shiites and Iran in their sermons.
On Tuesday, Egypt's hardline Daawa Salafiya, which is the foundation of the main Salafi political Al-Nour Party, released a statement calling on Morsi to confront Ahmadinejad on Tehran's support for the Syrian regime and make clear that "Egypt is committed to the protection of all Sunni nations."
On the other end of the political spectrum, liberal politician Mohamed Anwar Esmat Sadat, nephew of the late President Anwar Sadat, said in a statement Tuesday that he is concerned about the Brotherhood's ties with Iran.
President Sadat was assassinated after signing Egypt's peace treaty with Israel. Iran then outraged Egyptian officials when it named a street in honor of his assassin, Khaled al-Islambouli.
Ahmadinejad is scheduled to attend the summit of the Organization of Islamic Cooperation in Cairo, which starts Wednesday. Security officials said Ahmadinejad also will tour the Pyramids in Giza.
Morsi visited Tehran last year to attend an international summit in the first visit by an Egyptian leader to Iran in years. But Morsi used the opportunity in Tehran to lash out at Iran's ally, calling the Damascus regime "oppressive."
Egypt's leader has spearheaded an "Islamic quartet" of nations to try and resolve the Syrian crisis. The grouping includes Iran, as well as Turkey and Saudi Arabia, which are two of the most vocal critics of the Syrian president.
Saudi Arabia has largely abstained from the group's meetings in an apparent snub to Iran's Syria policies. Egyptian officials say they will try to revive those talks on the sidelines of this week's OIC summit.