This important complex marks the supposed burial place of Ebu Eyüp el-Ensari, a friend of the Prophet who fell in battle outside the walls of Constantinople while carrying the banner of Islam during the Arab assault and siege of the city (AD 674 to 678). His tomb is İstanbul's most important Islamic shrine.
Eyüp's grave was identified in a location outside the city walls immediately after the Conquest, and Sultan Mehmet II decided to build a grand tomb to mark its location. The mosque complex that he commissioned became the place where the Ottoman princes came for the Turkish equivalent of a coronation ceremony: girding the Sword of Osman to signify their power and their title as padişah (king of kings) or sultan. In 1766 Mehmet's building was levelled by an earthquake; a new mosque was built on the site by Sultan Selim III in 1800.
Be careful to observe Islamic proprieties when visiting, as this is an extremely sacred place for Muslims, ranking fourth after the big three: Mecca, Medina and Jerusalem. It's always busy on weekends and religious holidays.