Excavations have shown that the region was inhabited during the Late Copper Age, around 3000 BC.[2] The city came under the influence of the Hittites around 1500 BC. These were overtaken by the Sea Peoples around 1200 BC. The Phrygians established their kingdom in central Anatolia in the 8th century BC. Xenophon describes Iconium, as the city was called, as the last city of Phrygia. The region was overwhelmed by Cimmerian invaders c. 690 BC. It was later part of the Persian Empire, until Darius III was defeated by Alexander the Great in 333 BC. Alexander's empire broke up shortly after his death and the town came under the rule of Seleucus I Nicator. During the Hellenistic period the town was ruled by the kings of Pergamon. As Attalus III, the last king of Pergamon, was about to die without an heir, he bequeathed his kingdom to Rome. Under the rule of emperor Claudius, the city's name was changed to Claudioconium, and during the rule of emperor Hadrianus to Colonia Aelia Hadriana.
During the period of chaos that overwhelmed Anatolia after the Battle of Manzikert the city was conquered by the Seljuk Turks in 1084[4]. From 1097 to 1243 it was the capital of the Anatolian Seljuk Sultanate, though very briefly occupied by the Crusaders Godfrey of Bouillon (August 1097) and Frederick Barbarossa (May 18, 1190). The name of the town was changed to Konya by Rukn al-Dīn Mas'ūd in 1134.
Konya reached the height of its wealth and influence as of the second half of the 12th century when Anatolian Seljuk sultans also subdued the Anatolian beyliks to their east, especially that of the Danishmends, thus establishing their rule over virtually all of eastern Anatolia, as well as acquiring several port towns along the Mediterranean (including Alanya) and the Black Sea (including Sinop) and even gaining a momentary foothold in Sudak, Crimea. This golden age lasted until the first decades of the 13th century.
Alaeddin Mosque (1235) at Alaeddin Hill
By the 1220s, the city was filled with refugees from the Khwarezmid Empire, fleeing the advance of the Mongol Empire. Sultan Alā al-Dīn Kayqubād bin Kaykā'ūs fortified the town and built a palace on top of the citadel. In 1228 he invited Bahaeddin Veled and his son Mevlana (Rumi), the founder of the Mevlevi order, to settle in Konya.
In 1243, following the Seljuk defeat in the Battle of Köse Dağ, Konya was captured by the Mongols as well. The city remained the capital of the Seljuk sultans, vassalized to the Ilkhanate until the end of the century.
Following the fall of the Anatolian Seljuk Sultanate, Konya was made the capital of a beylik (emirate) in 1307 which lasted until 1322 when the city was captured by the neighbouring Beylik of Karamanoğlu. In 1420, Karamanoğlu fell to the Ottoman Empire and, in 1453, Konya was made the provincial capital of the Ottoman Province of Karaman.