While the first mosque in Egypt was the Mosque of Amr ibn al-As in Fustat, the Mosque of Ibn Tulun is the oldest mosque to retain its original form and is a rare example of Abbasid architecture, from the classical period of Islamic civilization. It was built in 876–879 AD in a style inspired by the Abbasid capital of Samarra in Iraq. It is one of the largest mosques in Cairo and is often cited as one of the most beautiful.