On October 19, 202 BC, during the Battle of Zama, Hannibal Barca and the Carthaginian army were defeated by Roman legions under Scipio Africanus thus effectively ending the Second Punic War. From the article:
"The Second Punic War (Spring 218 to 201 BC),[2][3][4] also referred to as The Hannibalic War and by the Romans the War Against Hannibal, was the second of three wars between Carthage and the Roman Republic and its allied Italic socii, with the participation of Greek polities and Numidian and Iberian forces on both sides. It was one of the deadliest human conflicts of ancient times. Fought across the entire Western Mediterranean region for 17 years and regarded by ancient historians as the greatest war in history, waged with unparalleled resources, skill and hatred,[5]:21.1 it saw hundreds of thousands killed, some of the most lethal battles in military history, the destruction of cities, and massacres and enslavements of civilian populations and prisoners of war by both sides.
The war began with the Carthaginian general Hannibal's conquest of the pro-Roman Iberian city of Saguntum in 219 BC, prompting a Roman declaration of war on Carthage in the spring of 218. Hannibal surprised the Romans by marching his army overland from Iberia to cross the Alps and invade Roman Italy, followed by his reinforcement by Gallic allies and crushing victories over Roman armies at Trebia in 218 and on the shores of Lake Trasimene in 217. Moving to southern Italy in 216, Hannibal at Cannae annihilated the largest army the Romans had ever assembled. After the death or imprisonment of 130,000 Roman troops in two years, 40% of Rome's Italian allies defected to Carthage, giving her control over most of southern Italy. Macedon and Syracuse joined the Carthaginian side after Cannae and the conflict spread to Greece and Sicily. From 215–210 the Carthaginian army and navy launched repeated amphibious assaults to capture Roman Sicily and Sardinia but were ultimately repulsed.
Against Hannibal's skill on the battlefield, the Romans adopted the Fabian strategy – the avoidance of battle against Hannibal and defeating his allies and the other Carthaginian generals instead. Roman armies recaptured all of the great cities that had joined Carthage and defeated a Carthaginian attempt to reinforce Hannibal at Metaurus in 207. Southern Italy was devastated by the combatants, with hundreds of thousands of civilians killed or enslaved. In Iberia, which served as a major source of silver and manpower for the Carthaginian army, a Roman expeditionary force under Publius Cornelius Scipio captured Carthago Nova, Carthage's capital city in Iberia, in 209. Scipio's destruction of a Carthaginian army at Ilipa in 206 permanently ended Carthaginian rule in Iberia. He invaded Carthaginian Africa in 204, inflicting two severe defeats on Carthage and her allies at Utica and the Great Plains that compelled the Carthaginian senate to recall Hannibal's army from Italy. The final engagement between Scipio and Hannibal took place at Zama in Africa in 202 and resulted in Hannibal's defeat and the imposition of harsh peace conditions on Carthage (Carthaginian peace), which ceased to be a great power and became a Roman client state until its final destruction by the Romans in 146 BC during the Third Punic War. The Second Punic War overthrew the established balance of power of the ancient world and Rome rose to become the dominant power in the Mediterranean Basin for the next 600 years."