After the end of the Byzantine empire, Istanbul (then Constantinople) fell back to the Roman Empire (Latin empire). The rift in the church between Rome and Byzantine significantly contributed to the decline of the city. It went financially bankrupt and the population declined. The glory days seen centuries ago was over.
Constantinople was officially conquered by the Ottomans, led by Sultan Mehmed II on May 29, 1453, after a 53-day siege. During the siege, the last Byzantine emperor, Constantine XI, died while defending his city. Almost immediately, Constantinople was declared to be the capital of the Ottoman Empire and its name was changed to Istanbul.
Mehmed entered Constantinople through what is now known as the Topkapi Gate. He converted Hagia Sofia into a Turkish mosque solidifying Turkish rule. Following the sack, Mehmed focused on rebuilding the city. Building projects included the repair of the walls, construction of the citadel, and building a new palace. Mehmed issued orders across his empire that Muslims, Christians, and Jews should resettle the city.
Today, Hagia Sofia is back in the news with the recent court ruling of transferring it back to a mosque from a museum.