Juba I, king of Numidia, was an Africa king who allied himself with Pompey during the Great Roman Civil War, defeating one of Caesar's armies in 49 BC before being defeated by Caesar in 46 BC.
Juba's father Hiempsal owed a great deal to Pompey. In 88 B.C. he had briefly sheltered the younger Marius, son of the great general Marius, after their party had been expelled from Rome by Sulla. Young Marius had been held in honourable captivity, and had soon managed to escape to join his father. This cost Hiempsal his throne. Marius's commander in North Africa, Cn. Domitius Ahenobarbus, deposed him and placed Hiarbas on the throne. This lasted until 81 BC when Pompey landed in Africa, defeated Domitius and restored Hiempsal. Juba thus owed some loyalty to Pompey, while Caesar was later seen as representing the Marian party in Rome.
Juba first clashed with Caesar directly in 62 BC, when Caesar was serving as a praetor. Caesar chose to defend Masintha, a young African nobleman, against King Hiempsal. Juba was sent to Rome to argue his fathers case. When the issue came to court the arguments were so fierce that at one point Caesar seized Juba by the beard. The case went against Masintha, who was judged to be tributary to Hiempsal. Juba and his supported attempted to seize Masintha, and a street battle broke out between Juba's men and Caesar's party, which ended in victory for Caesar. Masintha was hidden in Caesar's house until the end of his year of service, and he then escaped from Rome in Caesar's litter as Caesar left the city to take up his post in Spain.
Juba inherited his father's throne at some point between 62 BC and 50 BC. In this last year he was further alienated from Caesar by the actions of C. Scribonius Curio, one of the Tribunes for the year. Curio had originally been a supporter of Pompey, but his loyalty had been bought by Caesar, who cleared his massive debts. One of the laws that Curio proposed during his year in office would have seen Juba's kingdom of Numidia turned into a Roman province.
In 49 BC, when Curio landed in North Africa at the head of two of Caesar's Legions, it was thus inevitable that Juba would side with Pompey. Pompey's forces in North Africa were commanded by P. Attius Varus, who was based with two legions at the city of Utica. Curio landed some way to the east of Utica and marched west towards the city, winning a minor victory outside Utica and forcing Varus to seek safety inside the walls (siege of Utica).
While this was going on Juba was approaching at the head of a strong army. At first Curio responded intelligently, retreating into the Castra Cornelia, a strong position that had been used by Scipio during the siege of Utica 150 years earlier. He summoned his remaining two legions and prepared to wait for reinforcements.
Juba managed to lure Curio out of this strong position by spreading a rumour that he had been forced to return home to deal with a rebellion, leaving a small army under his general Saburra on the River Bagradas (east of Utica and the Castra Cornelia). Curio fell for the trap, left his camp, and advanced towards a crushing defeat (Battle of the Bagradas River, 49 BC). He was killed in the battle and most of his two legions killed. Many of the survivors surrendered to Varus, but were then massacred by Juba after his arrival at Utica.
Juba's triumph only lasted for three years. In 46 BC Caesar finally arrived in Africa in person, intending to defeat the last major Pompeian army, led by Scipio and Cato. Juba gathered his army and was on his way to join Scipio when an unexpected ally appeared on Caesar's side. P. Sittius was a Roman soldier of fortune who for some years had been working as a mercenary in North Africa. By 46 BC he commanded a sizable army and fleet, and decided to throw his weight behind Caesar. Sittius, in alliance with Bocchus, king of Mauritania, invaded Numidia and captured Juba's capital of Cirta.
Juba was forced to turn back, sending only 30 elephants to join Scipio. After a short period operating against Sittius Huba was persuaded to join Scipio, leaving his general Saburra to deal with Sittius and Bocchus. This move ended in total disaster. Saburra was defeated and killed in battle with Sittius.
Juba brought a large army to Scipio, including three legions of armoured infantry, 800 well-armed cavalry, the thirty elephants mentioned earlier, and a sizable number of lightly armed infantry and cavalry. This sizable contingent was of little actual value to Scipio. The Numidian cavalry was defeated in a cavalry clash soon after it arrived. During the final decisive battle of Thapsus the Numidian elephants were soon put to flight, and the rest of the Numidian army was generally ineffective. Juba attempted to flee from the site of the defeat into the city of Zama, which he had prepared for a siege, but the citizens of the city were less keen, and the city gates were closed against him.
This setback was followed by news of Saburra's defeat and of Cato's suicide at Utica. Juba, and the Roman general M. Petreius retreated to one of Juba's houses, where with no hope left they killed themselves, possibly in a duel.
Juba's young son, also Juba, was taken to Rome and featured in Caesar's triumph. He was then raised by Caesar and his family, serving the young Octavian. As a reward for his service during Octavian's own civil wars Juba was restored to his fathers kingdom, as Juba II (30 BC), but after five years was moved to Mauritania, where he remained in power for nearly fifty years.