The Numidians were the Berber population of Numidia (present day Algeria and in a smaller part of Tunisia). The Numidians were one of the earliest Berber tribes to trade with the settlers of Carthage. As Carthage grew, the relationship with the Numidians blossomed. Carthage's military used the Numidian cavalry as mercenaries. Numidia provided some of the highest quality cavalry of the Second Punic War, and the Numidian cavalry played a key role in a number of battles, both early on in support of Hannibal and later in the war after switching allegiance to the Roman Republic.
During the Punic Wars, Syphax was the king of the largest Numidian kingdom, the Masaesyli. In 213 BC, Syphax ended his alliance with Carthage. In 208 BC, he rejoined after marrying Sophonisba, daughter of Hasdrubal Gisco.
During the Second Punic War, Syphax sued for peace between Hannon Barca and Publius Cornelius Scipio after the Romans had landed in Africa. With the help of Masinissa, Publius Scipio's troops set fire to Syphax's camp. The king Masinissa added Syphax's former territory to his eastern kingdom Massylii as a reward gained through military victory against Carthage. After the Second Punic War, Massinissa combined the Amazigh people into a united nation with an agricultural industry.
The peace treaty between Carthage and Rome after the Second Punic Wars prevented Carthage from entering any wars without Rome's permission. Masinissa exploited the treaty by taking Carthaginian land. He used various tricks to get land including stating that Carthage was rebuilding their Navy despite the treaty which prohibited a Navy. When Carthage asked for an appeal Cato the Elder was sent with a commission to mediate a settlement. The commission insisted that both sides agree to their final decision. Masinissa agreed, but Carthage refused because of how unfavorable previous Roman decisions had been. Cato, who had served in the Roman Legion during the Second Punic War, was convinced by Carthage's refusal to accept the commission that the Third Punic War was needed. Cato made a series of speeches to the senate all of which ended with "Ceterum censeo Carthaginem esse delendam" (Moreover, I advise that Carthage should be destroyed).
A group of Carthaginian senators supported a peace treaty with the Numidians. This group was in the minority, in part because the populace of Carthage did not want to submit to a people they had traditionally dominated. The pro-Numidians were eventually exiled. Upon exile they went to Masinissa for help. Masinissa sent two sons to ask for the pro-Numidians to be let back in. Carthalo, who led a democratic group who were against the Numidian encroachment, blocked their entry. Hamilcar, another leader of the same group, sent a party to attack Masinissa's sons.
Masinissa sent a force to siege the Carthaginian city of Oroscopa but they were repelled by a Carthaginian army led by a Hasdrubal. Among the captured were two of Masinissa's sons. This became the final excuse for Rome to attack Carthage. In 149 BC, Masinissa died of old age. His death occurred during the Third Punic War. Micipsa became the second king of Numidia.