Juba was the son of King Juba I of Numidia (85 B.C - 46 B.C.), who had been defeated (in 60 B.C.) by the Romans, who then made Numidia (in northern Africa) a Roman province. Juba II had been reared in Rome, and in 25 B.C. Augustus Caesar restored him to the throne of Numidia and sent Juba and his wife (who had also been reared in Rome) to rule the country in what Augustus hoped would be cooperation with Rome. Juba was too Roman to suit the Numidians and finally had to give up and leave the country.
After Cleopatra Selene died, Juba married Glaphyra, daughter of King Archelaus of Cappadocia and widow of a grandson (Alexander) of Herod the Great, but they apparently divorced, because she later married another (Archelaus) of Herod's grandsons. When Juba died in 23 A.D., his son Ptolemy of Mauretania succeeded him on the throne, but Caligula killed him in 40 A.D. and annexed Mauretania to Rome.
Juba wrote a number of books, mostly on history or natural history, but only his guidebook on Arabia became a best-seller in Rome. He explored Madeira and the Canary Islands, and Pliny wrote that Juba was the first person to see them, but in the 14th century the Portuguese would claim to have discovered them. One of Juba's discoveries during his explorations was the medicinal plant named Euphorbia regis jubae for him ("euphorbia king juba"; Euphorbia is a genus of the spurge family).