The dome belonged to the Byzantine church of Agia Sofia. The minaret was added when the Ottomans turned the church into a mosque.