See Niğde Province for a summary of the history of the region, which goes back a long way. This is rich farmland near a number of ancient trade routes, particularly the road from Kayseri (ancient Caesarea) to the Cilician Gates. Settlers throughout history include Hittites, Assyrians, Greeks, Armenians, Romans, Byzantines and finally Turks from 1166 onwards. In the early Middle Ages, it was known as Magida (), and was settled by the remaining inhabitants of nearby Tyana after the latter fell to the Arabs in 708/709. By the early 13th century Niğde was one of the largest cities in Anatolia. After the fall of the Sultanate of Rûm (of which it had been one of the principal cities), Niğde was captured by Anatolian beyliks such as Karaman Beylik and Eretna Beylik. According to Ibn Battuta, ruinous, and did not pass into Ottoman hands till the time of Mehmet II.