The top of the rock in Afyon has been fortified for a long time. It was known to the Hittites as Hapanuwa, and was later occupied by Phrygians, Lydians and Achaemenid Persians until it was conquered by Alexander the Great. After the death of Alexander the city (now known as Akroinοn (Ακροϊνόν) or Nikopolis (Νικόπολις) in Ancient Greek), was ruled by the Seleucids and the kings of Pergamon, then Rome and Byzantium. The Byzantine emperor Leo III after his victory over Arab besiegers in 740 renamed the city Nicopolis (Greek for "city of victory"). The Seljuq Turks then arrived in 1071 and changed its name to Kara Hissar ("black castle") after the ancient fortress situated upon a volcanic rock 201 meters above the town. Following the dispersal of the Seljuqs the town was occupied by the Sâhib Ata and then the Germiyanids.