during the Paleolithic era as far back as , and archeological evidence shows a port existed at Syedra, south of the modern city, during the Bronze Age around . A Phoenician language tablet found in the district dates to , and the city is specifically mentioned in the 4th-century BC Greek geography manuscript, the periplus of Pseudo-Scylax. The castle rock was likely inhabited under the Hittites and the Achaemenid Empire, and was first fortified in the Hellenistic period following the area's conquest by Alexander the Great. Alexander's successors left the area to one of the competing Macedonian generals, Ptolemy I Soter, after Alexander's death in . His dynasty maintained loose control over the mainly Isaurian population, and the port became a popular refuge for Mediterranean pirates. The city resisted Antiochus III the Great of the neighboring Seleucid kingdom in , but was loyal to the pirate Diodotus Tryphon when he seized the Seleucid crown from 142 to . His rival Antiochus VII Sidetes completed work in on a new castle and port, begun under Diodotus. The Roman Republic fought Cilician pirates in , when Marcus Antonius the Orator established a proconsulship in nearby Side, and in under Servilius Vatia, who moved to control the Isaurian tribes. The period of piracy in Alanya finally ended after the city's incorporation into the Pamphylia province by Pompey in , with the Battle of Korakesion fought in the city's harbor. In Strabo's reckoning, Coracesium marked the boundary between ancient Pamphylia and Cilicia (Cilicia Trachaea, in particular); though other ancient authors placed the boundary elsewhere. Isaurian banditry remained an issue under the Romans, and the tribes revolted in the fourth and fifth centuries AD, with the largest rebellion being from 404 to 408. With the spread of Christianity Coracesium, as it was called, became a bishopric. Its bishop Theodulus took part in the First Council of Constantinople in 381, Matidianus in the Council of Ephesus in 431, Obrimus in the Council of Chalcedon in 451, and Nicephorus (Nicetas) in the Third Council of Constantinople in 680. Coracesium was a suffragan of the metropolitan see of Side, the capital of the Roman province of Pamphylia Prima, to which Coracesium belonged. It continued to be mentioned in the Notitiae Episcopatuum as late as the 12th or 13th century. No longer a residential bishopric, Coracesium is today listed by the Catholic Church as a titular see. Islam arrived