Located at the confluence of the Klang and Gombak Rivers, Kuala Lumpur quickly grew into a settlement for early immigrants engaged in the flourishing tin-mining trade in the hinterland. The town was established in 1857, when a group of Bugis tin-miners led by Raja Abdullah landed here. Later, the arrival of Chinese immigrants attracted by the possibility of making their fortunes in the tin trade, brought more development. They were put under the control of Chinese Kapitan or headmen, the most famous of whom is Yap Ah Loy.
In 1870, civil war erupted with the Chinese community being split along partisan lines into the Cantonese Ghee Hin or the Hakka Hai San secret societies. The British were called in to help end the strife but many of the buildings in the settlement were burnt down or severely damaged. The rebuilding of Kuala Lumpur in 1882 is credited to Sir Frank Swettenham, the British Resident of Selangor at the time. He was responsible for the street plan of what is now the older part of Kuala Lumpur City, and some of the landmark colonial heritage buildings were built during his time in office.
Years later, with the formation of the Federated Malay States in 1896, the states of Negeri Sembilan, Perak, Pahang and Selangor were united under a central administration based in Kuala Lumpur. Vast infrastructure improvements followed, with new houses and roadways.
When the country achieved independence in 1957, Kuala Lumpur was declared the capital of the Federation of Malaya and, later, Malaysia in 1963. As the central hub of government and business, the city grew quickly and was given city status in 1972. Kuala Lumpur was declared a federal territory on 1 February 1974.