Before the 15th century, Senegal was a part of kingdoms such as the Kingdoms of Djolof and Ghana. The 11th century saw Islam arrive in the country. However, many locals still put their faith in animistic beliefs. The 16th century was when Europeans arrived and the Dutch purchased Goree Island. The French started a factory on N’Dar, an island that became an old town of St. Louis. In 1677 the French took control of Goree Island and turned it into an active base for the slave trade.
In 1959 the Federation of Mali was created between Senegal and French Sudan and the country remained a colony of France. In 1960 the sovereign nations of Senegal and Mali were formed as the federation gained independence from France. The renowned poet and politician Leopold Sedar Senghor became the first president of Senegal. He ruled for 20 years and the country has played a prominent part in African politics. Diplomatic, economic and cultural ties remained with France. The confederation of Senegambia was formed in 1982 between Senegal and the Gambia. However, the integration fell apart in 1989 and the federation was dissolved.