The Byzantine Empire, unable to hold the city against the Ottoman Empire's advance, handed it over in 1423 to the Republic of Venice. Venice held the city until it was captured after a three-day-long siege by the Ottoman Sultan Murad II, on 29 March 1430. The Ottomans had previously captured Thessaloniki in 1387, but lost it in the aftermath of their defeat in the Battle of Ankara against Tamerlane in 1402, when the weakened Ottomans were forced to hand back a number of territories to the Byzantines.