Under the Roman Republic and Empire, a region of Africa north of the Sahara was known as Numidia, and at various points, its borders roughly corresponded to those of western Tunisia and eastern Algeria today. Tribes and clans made up its earliest inhabitants. Physically identical to the other native people of early North Africa, they were frequently referred to as Berbers by the end of the Roman Empire.
The Carthaginians began colonizing coastal areas in the sixth century BCE, and by the third century BCE, they had reached Theveste (Tébessa) in the interior. By that time, Numidian cavalry was frequently present in Carthaginian armies.Up until the time of Masinissa, the leader of the Massaesyli tribe, who lived close to Cirta, the people continued to live a semi-nomadic lifestyle (Constantine). He initially supported Carthage in the Second Punic War, but in 206 BCE he switched sides and joined the Romans, joining them in receiving additional territory that reached as far as the Mulucha (Moulouya) River. Near Utica, the camp of the rival Numidian chief Syphax was destroyed by Roman forces led by Scipio Africanus and Numidians under Masinissa.
Syphax and his Carthaginian allies were then routed by Roman forces at the Battle of Bagrades in 203 BCE. Rome had courted Syphax, but when he wed Sophonisba, the Carthaginian commander Hasdrubal's daughter, his loyalty to Carthage was solidified. Captured and banished to Rome, Syphax passed away at Tibur (modern Tivoli).
Later advancements in Roman cavalry eventually drew on Numidian horsemanship, animal breeding, and cavalry tactics. Polybius emphasizes how crucial those cavalry advantages were to the outcome of the Second Punic War in his history of Rome. The cavalry leadership of Maharbal under Hannibal at Trasimene and Cannae, and later by Masinissa at Zama under Scipio Africanus, proved the superiority of the Numidians. Masinissa managed to maintain Rome's backing for nearly 50 years while he worked to convert the Numidian pastoralists into peasant farmers. He also seized a significant amount of Carthaginian land and likely intended to rule over all of North Africa.
The Romans wisely divided Masinissa's kingdom among several chieftains upon his death in 148 BCE, but the Numidians' advancement in civilization was not significantly halted. After Carthage was destroyed in 146 BCE, thousands of Carthaginians fled to Numidia, giving civilization a fresh boost. Unlawful Numidian prince Jugurtha usurped the throne in 118 and forcibly united Numidia until the Romans regained control in 105. Through client kings, Rome maintained its hegemonic position over Numidia, despite the substantial shrinkage of Numidian territory.