According to a rumor, Abu Ayyub al-Ansari (Khalid Bin Zayd) who joined the siege of Istanbul with Umayyad army in the 7th century was buried at the location as far as the Islamic armies reached during their march according to his testament. Prophet Muhammad had been a guest at his home while immigrating to Medina in 622, and he attended wars with him as a vexillary, not leaving his side. During the siege of Istanbul by Ottomans, Sultan Mehmet the Conqueror made a mosque and a mausoleum to the area where Akşemseddin, teacher of Sultan Mehmet the Conqueror found the tomb of Abu Ayyub al-Ansari in 1458 and 1459.
Selim III (1789-1807) rebuilt the mosque except the minarets in 1798 and 1800 which was ruined as a result of the earthquake in 1766. Octagonal plan with central domed which is supported by piers was used during the construction of the mosque. Main venue covered by gallery floors in three sides is covered by a dome with 17,5 meter in diameter.
Eyüp Sultan mausoleum in the interior courtyard of the mosques is the most visited mausoleum since it was built. Wall tiles were produced in Iznik in the 16th century.