Iranian President Mahmoud Ahmadinejad's visit to Cairo on Tuesday, the first by an Iranian leader in more than three decades, highlighted efforts by Egypt's Islamist leader to thaw long-frigid ties between the two regional heavyweights.

Although the official welcome was warm, there was unscripted discord from Sunni protesters angry over Iran's support for the regime of Syrian President Bashar Assad, as well as decades of sectarian animosity between Shiite-led Iran and the region's Sunni majority.

At one point, Ahmadinejad was forced to flee an ancient mosque in downtown Cairo after a Syrian protester took off his shoes and threw them at him. Later, anti-Iranian protesters raised their shoes up while blocking the main gates to Al-Azhar, the Sunni world's most prestigious religious institution, where Egypt's most prominent cleric chided Ahmadinejad for interfering in the affairs of Sunni nations.

Also Tuesday, Iran formally agreed to a new round of nuclear talks with the United States and five other world powers, the European Union said. EU and Iranian officials signed off on a Feb. 26 meeting in the former Kazakh capital of Almaty, ending months of haggling over where and when negotiations would take place.