In 1204, however, the armies of the Fourth Crusade took and devastated the city, and its inhabitants lived several decades under Latin rule. In 1261 the Byzantine Emperor Michael VIII Palaiologos liberated the city, and after the restoration under the Palaiologos dynasty, enjoyed a partial recovery. With the advent of the Ottoman Empire in 1299, the Byzantine Empire began to lose territories and the city began to lose population. By the early 15th century, the Byzantine Empire was reduced to just Constantinople and its environs, along with Morea in Greece, making it an enclave inside the Ottoman Empire; after a 53-day siege the city eventually fell to the Ottomans, led by Sultan Mehmed II, on 29 May 1453, whereafter it replaced Edirne (Adrianople) as the new capital of the Ottoman Empire.