At the Battle of Köse Dağ in 1243, the Mongol hordes broke the Seljuk hegemony in Anatolia. Alanya was then subject to a series of invasions from Anatolian beyliks. Lusignans from Cyprus briefly overturned the then ruling Hamidid dynasty in 1371. The Karamanids sold the city in 1427 for 5,000 gold coins to the Mamluks of Egypt for a period before General Gedik Ahmed Pasha in 1471 incorporated it into the growing Ottoman Empire. The city was made a capital of a local sanjak in the eyalet of Içel. The Ottomans extended their rule in 1477 when they brought the main shipping trade, lumber, then mostly done by Venetians, under the government monopoly. On September 6, 1608, the city rebuffed a naval attack by the Order of Saint Stephen from the Duchy of Florence.