A video released by the Anadolu news agency shows a man throwing a show at Ahmadinejad. According to the Egyptian public prosecutor's office, other men also threw shoes at him.
"You killed our brothers!" one of the assailants shouted, according to Anadolu. The agency said the man's shoe struck a security guard.
The prosecutor's office said that the men behind the attack were Salafis who follow the Sunni Muslim doctrine and are against the involvement of Shias in the political activities of Egypt which as a majority Sunni population. This also shows the anger among Egyptians for Iran's support for the regime of Syrian President Bashar Assad
Ahmadinejad's visit to Egypt is the first by an Iranian president in more than 30 years.
He was in Cairo visiting the Grand Sheikh of Al Azhar, Ahmed el-Tayeb. The al-Ahram news agency said Ahmadinejad also visited the historic Al-Hussein mosque.