Finds in the nearby Karain Cave indicate occupation 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.