In 218, the Second Punic War broke out. Setting out from the Carthaginian province Iberia, general Hannibal Barca invaded Italy, where he defeated the Romans several times. Because they were unable to overcome him, they decided to cut off his base in Iberia. Their two commanders Publius and Gnaeus Cornelius Scipio were successful in northeastern Iberia, but Hannibal's brother Hasdrubal Barca was able to keep the southern and central parts of Iberia. In 211, he received support from Mago Barca and Hasdrubal, son of Gesco, and defeated the Scipio brothers. They died in action.
However, the three Carthaginian commanders -the two Hasdrubals and Mago- were unable to exploit their victory. They were on bad terms and went to various parts of Iberia to recruit additional soldiers. In the spring of 209, Hasdrubal Barca was in Central Iberia; Mago near Gibraltar; and Hasdrubal, son of Gesco, near the mouth of the river Tagus. Unexpectedly, the Roman commander Publius Cornelius Scipio, the son of the man who had been killed in 211, captured the Carthaginian capital in Iberia, New Carthage (modern Cartagena).
One year later, he fought himself a way into Andalusia, and although Hasdrubal Barca was able to regroup his army, cross the Pyrenees and invade Italy, Iberia was forever lost. The Carthaginians were unable to restore their fortunes, and in 206, they were decisively beat at Ilipa, north of modern Seville.
Returning to Africa, Hasdrubal, son of Gesco, was faced with the consequences. Carthage had always been allied to the east Numidian ruler Massinissa of the Massylians, and had had a less easy relation to king Syphax of the Masaeisylians in western Numidia. Massinissa had been fighting in Iberia, and had seen what Roman power meant. After the defeat at Ilipa, he opened negotiations with Scipio. In his turn, Hasdrubal, son of Gesco, opened negotiations with Syphax, who did indeed come over to the Carthaginian side and married Hasdrubal's daughter Sophoniba.
Meanwhile Scipio, the conqueror of Hispania, returned to Rome, was chosen consul, and sent to Sicily. In 203, he invaded Africa, where he and Massinissa defeated Hasdrubal and Syphax in the battle of the Great Plains. Now, Carthage recalled Hannibal. There are reports that Hasdrubal was convicted and forced to commit suicide, but they are unreliable. What is certain is that in 202, Scipio defeated Hannibal at Zama. Carthage surrendered almost immediately.