Mali is a landlocked republic in Africa, bounded north-west by Mauritania, north-east by Algeria, west by Senegal, east by Niger, and south by Burkina Faso, Ivory Coast, and Guinea. Mali played an important role in the Saharan trade routes prior to the sixteenth century, becoming a centre of learning and an exporter of exotic goods. The country was strategically pivotal to three empires - the Ghana Empire (c 400–c. 1200), the Mali Empire (c. 1230-c. 1600), the Songhai Empire (c. 1340–1591). A Moroccan invasion led by Judar Pasha in 1591, ended Mali's role in Saharan trade. Following a devastating famine in the eighteenth century, Mali came under the influence and control of France, and in 1881, the region was annexed as part of French Sudan. In 1958, it became an autonomous state within the French community, and united with Senegal to form the Federation of Mali in 1959. The nation formally achieved independence in 1960 but Senegal withdrew within two months, and Mali proclaimed itself a sovereign state on 22 September 1960. The capital and largest city is Bamako. The population of Mali in the 2009 census was 14,517,176.