Numidia was an ancient Berber kingdom located in the region of North Africa that today comprises Algeria and parts of today Tunisia, Libya and Morocco. The kingdom existed from the 3rd to the 1st century BC. Numidia was originally composed of two large kingdoms: the Massyles in the east and the Massaessyles in the west, until it was unified into a single kingdom by Massinissa. Rome established it as a client kingdom after the Second Punic War and annexed it, first in 46 BC and again in 25 BC after a brief period of restored independence under King Juba II.