Present day Benin was the site of Dahomey, a prominent West African kingdom that rose in the 15th century. Located between Nigeria and Togo, the territory became a French colony in 1870s and achieved independence in 1960. In 1975, it changed its name from Dahomey to Benin. A succession of military governments ended in 1972 with the establishment of a socialist government, but social unrest and economic difficulties in the late 1980s led the country away from socialism. In 1991 elections ushered in the first popularly elected president, marking the first successful transfer of power in Africa from a dictatorship to a democracy. Benin’s economy remains underdeveloped and is mainly based on agriculture. Despite being one of Africa’s largest cotton producers, it ranks among the world's poorest countries.