in the 7th century with Arab raids, which led to the construction of new fortifications. The area fell from Byzantine control after the Battle of Manzikert in 1071 to tribes of Seljuk Turks, only to be returned in 1120 by John II Komnenos. Following the Fourth Crusade's attack on the Byzantines, the Christian Armenian Kingdom of Cilicia periodically held the port, and it was from an Armenian, Kir Fard, that the Turks took lasting control in 1221 when the Anatolian Seljuk Sultan Alaeddin Kayqubad I captured it, assigning the former ruler, whose daughter he married, to the governance of the city of Akşehir. Seljuk rule saw the golden age of the city, and it can be considered the winter capital of their empire. Building projects, including the twin citadel, city walls, arsenal, and Kızıl Kule, made it an important seaport for western Mediterranean trade, particularly with Ayyubid Egypt and the Italian city-states. Alaeddin Kayqubad I also constructed numerous gardens and pavilions outside the walls, and many of his works can still be found in the city. These were likely financed by his own treasury and by the local emirs, and constructed by the contractor Abu 'Ali al-Kattani al-Halabi. Alaeddin Kayqubad I's son, Sultan Gıyaseddin Keyhüsrev II, continued the building campaign with a new cistern in 1240. 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. Trade in the region was negatively impacted by the development of an oceanic route from Europe around Africa to India, and in the tax registers of the late sixteenth century, Alanya failed to qualify as an urban center. In 1571 the Ottomans designated the city as part of the newly