End of the First Punic War
In 242 BCE, after a period of stalemate and guerilla warfare, the Romans mustered a fleet of 200 warships to attack Lilybaeum, Sicily. This attack was successful, despite the city being blockaded rather than captured. This was possibly because the Romans intercepted a fleet of Carthaginian ships arriving to rescue the town - 50 of Carthage’s vessels were sunk, 70 were captured, and the Romans gained control of Sicily. Given the strategic importance of the island and their depleted resources, Carthage surrendered and began peace negotiations.
Lutatius Catulus and his brother Lutatius Cerco, led the peace negotiations for Rome in 241 BCE. They managed to ensure that Carthage gave up its territory of Sicily and the Lipari (Eolie) Islands, and paid a fine of 3,200 talents. Sicily was the first foreign province that Rome had ever controlled.
However, this peace did not last and many people of Carthage wanted revenge for the First Punic War. Due to the defeat, unrest spread through other Carthaginian territories, especially in Libya, and in 238 BCE Sardinia attempted to surrender to Rome.
Carthage owed its veteran and mercenary army years of back pay but had to pay the Romans a large down payment on its indemnity first - creating a cash flow issue, leading to its own army to revolt.
The rebels were joined by the subject Libyans who had been squeezed for taxes during the First Punic War. The subsequent revolt brought Carthage to the brink of destruction and was very savagely fought - being called by Polybius the ‘Truceless War’ and lasting over three years. It left Carthage in no condition to resist Roman intervention in Sardinia.
Carthage was beginning to lose control of its empire. Instead of risk another war, Carthage was forced to agree that Rome could control the territories of Sardinia and Corsica, and pay another fine.
Many Carthaginians were outraged by the defeat and humiliation over Sardinia and wanted revenge. Hamilcar Barca decided that Carthage should expand into Spain, and took an army to the peninsula.