Initially a small Phoenician harbor for maritime trading in the western Mediterranean, the settlement lay 30 km (18.5 mil) north of Utica and 50 km (31 mil) northwest of Carthage, other cities founded by Phoenicians. Around 950 BC the city came under the influence of Carthage during the reign of Queen Dido/Elissa, In 309 BC, during the Greek–Punic Wars and after the defeat of Agathocles, the city and Sicily returned to the Carthaginian Republic. Several Carthaginian generals used its port during the Punic Wars of 264-146 BC – such as Hamilcar Barca, Mago, Hasdrubal and Hannibal.