Video of the incident shows a man shouting “coward” as he strikes out.
It is not clear what the motive was – some reports suggested it was against Iran’s support for Syria’s government.
Mahmoud Ahmadinejad is the first Iran leader to visit Egypt since the 1979 Islamic revolution. Showing the sole of a shoe is a grave insult in the Arab world.
The Iranian leader is attending a summit of the Organization of Islamic Co-operation, a loose grouping of 57 mainly Muslim countries.
Egypt’s new Islamist President Mohamed Morsi has sought to follow an independent path on foreign policy and travelled to Tehran soon after coming to power last year.
However, so far his talks with Iran about its policy towards Syria have had little impact.
Tuesday’s incident occurred as Mahmoud Ahmadinejad was leaving Cairo’s Al-Hussein mosque.
Video released by Turkish news agency Anadolu shows a man straining forward in the crowd with a shoe in his hand, striking out several times.
A witness quoted by AFP news agency said the man had booed and pushed a bodyguard.
The man, believed to be Syrian because of his accent, was reportedly arrested by police after being restrained by security guards.
While the motive for the attack was unclear, the visit of the president of solidly Shia Muslim Iran has caused some friction
in mainly Sunni Muslim Egypt.
Outside the mosque, four youths waved placards scrawled with slogans against Iran over its support for Syrian President Bashar al-Assad.
There was embarrassment earlier on Wednesday when one of Egypt’s top Sunni Muslim clerics, Ahmed al-Tayyeb, publicly criticized Shia Islam at a meeting with Mahmoud Ahmadinejad.
Ahmed al-Tayyeb, the grand imam of al-Azhar, Sunni Islam’s highest seat of learning, told the Iranian leader not to interfere in the internal affairs of Sunni states and condemned the “spread of Shia-ism in Sunni lands”.
He singled out Bahrain, where Iran is accused of stirring up unrest among the Shia majority against the Sunni monarchy.
E2vW7Eq2ZRgThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…