Cagliari has been inhabited since ancient times. It occupies a favourable position between the sea and a fertile plain, and is surrounded by two swamps (which afforded defences from enemies from inner lands) and is close to high and green mountains (to which people could evacuate if everything else was lost). Some testimonies of prehistoric inhabitants were found in Monte Claro and in Cape Sant'Elia.
Under the name of Karalis it was established around the 7th century BC as one of a string of Phoenician colonies in Sardinia, including Tharros. Its foundation is expressly assigned to its opportune situation for communication with Africa as well as its excellent port, it doubtless assumed under their government the same important position it occupied under the Romans. It passed with the rest of the island first to the control of Carthage and then to Rome in 238 BC when the Romans defeated the Carthaginians. No mention of it is found on the occasion of the Roman conquest of the island; but during the Second Punic War, it was the headquarters of the praetor, T. Manlius, from whence he carried on his operations against Hampsicora and the Carthaginians, and appears on other occasions also as the chief naval station of the Romans in the island, and the residence of the praetor.
Florus calls it the urbs urbinum, or capital of Sardinia, and represents it as taken and severely punished by Gracchus, but this statement is wholly at variance with the account given by Livy, of the wars of Gracchus, in Sardinia, according to which the cities were faithful to Rome, and the revolt was confined to the mountain tribes. In the Civil War between Caesar and Pompey, the citizens of Caralis were the first to declare in favor of the former, an example soon followed by the other cities of Sardinia; and Caesar himself touched there with his fleet on his return from Africa. A few years later, when Sardinia fell into the hands of Menas, the lieutenant