In 1859, Albert Roscher of Hamburg became the first European to land in Mzizima ("healthy town"). In 1866 Sultan Seyyid Majid of Zanzibar gave it its present name, an Arabic phrase meaning Haven of Peace. Dar es Salaam fell into decline after Majid's death in 1870, but was revived in 1887, when the German East Africa Company established a station there. The town's growth was facilitated by its role as the administrative and commercial center of German East Africa and industrial expansion resulting from the construction of the Central Railway Line in the early 1900s.
German East Africa was captured by the British during World War I and from then on referred to as Tanganyika. Dar es Salaam was retained as the territory's administrative and commercial center. Under British indirect rule, separate European (e.g. Oyster Bay) and African (e.g. Kariakoo and Ilala) areas developed at a distance from the city center. The town's population also included a large amount of South Asians.
After World War II, Dar es Salaam experienced a period of rapid growth. Political developments, including the formation and growth of the Tanganyika African National Union (TANU), led to Tanganyika attaining independence from colonial rule in December 1961. The new state was named Tanzania, and Dar es Salaam continued to serve as its capital. However, in 1973 provisions were made to relocate the capital to Dodoma, a more centrally located city in Tanzania's interior. The relocation process has not yet been completed, and Dar es Salaam remains as Tanzania's primate city.