Numidia (202 BC – 40 BC, Berber: Inumiden) was an ancient Berber kingdom of the Numidians, located in what is now Algeria and a smaller part of Tunisia and Libya in the Berber world, in North Africa. The polity was originally divided between Massylii in the east and Masaesyli in the west. During the Second Punic War (218–201 BC), Massinissa, king of the Massylii, defeated Syphax of the Masaesyli to unify Numidia into one kingdom. The kingdom began as a sovereign state and later alternated between being a Roman province and a Roman client state. It was bordered by Atlantic ocean to the west, Africa Proconsularis (modern-day Tunisia) to the east, the Mediterranean Sea to the north, and the Sahara Desert to the south. It is considered to be one of the first major states in the history of Algeria and the Berber world.