Mr Ahmadinejad's visit follows one to Tehran by Mr Morsi for a summit of the Non-Aligned Movement in August, when the two leaders agreed to reopen embassies.
Egyptian officials have been keen to note that Mr Morsi would stay only for the few hours needed formally to pass the rotating chairmanship of the Non-Aligned Movement on from Egypt to Iran: a summit meeting, held every three years, was declared open on August 30th.