Karahisar-ı Sâhib
Karahisar-ı Sâhib takes its name from the black volcanic rock, rising over two hundred metres above the town, that carries a fortress the Hittites knew as Hapanuwa. The Turks held it firmly only from around 1210. After the Seljuk defeat at Köse Dağ in 1243, the vizier Sâhib Ata Fahreddin Ali received the region, and in 1275 the beylik of his descendants made Karahisar its capital, the origin of the name 'Sâhib'. The Ulu Mosque, raised in 1272 on forty wooden pillars, and a Mevlevi lodge founded by a disciple of Rumi recall this Seljuk age.
In 1341 the town was added to the Germiyanid beylik, and in 1390 it passed to the Ottomans under Bayezid I. After Timur's victory at Ankara in 1402 it returned to the Germiyanids, and it was recovered for the Ottomans in the late 1420s. The vizier Gedik Ahmed Pasha endowed a madrasa here in 1472, and the town became the seat of a sanjak, known in Ottoman documents as Karahisar-ı Sâhib. By 1684 the shorter form Afyonkarahisar, 'opium black castle', appeared in records. In 1833 forces of Ibrahim Pasha of Egypt seized the town, but it returned to Ottoman rule within the year.