Gorée, including Dakar, was recognised as a French ''commune'' in 1872. Dakar itself was split off from Gorée as a separate ''commune'' in 1887. The citizens of the city elected their own mayor and municipal council and helped send an elected representative to the National Assembly in Paris. Dakar replaced Saint-Louis as the capital of French West Africa in 1902. A second major railroad, the Dakar-Niger built from 1906–1923, linked Dakar to Bamako and consolidated the city's position at the head of France's West African empire. In 1929, the ''commune'' of Gorée Island, now with only a few hundred inhabitants, was merged into Dakar.