El Gamal had just returned from his tour of South Sudan, having participated in its independence celebrations, Xinhua reported.
His resignation had been one of the demands of many protesters in Tahrir Square in downtown Cairo over the past few days.
El Gamal was appointed to the post in late February.