In the 15th century, Selangor was ruled by the Sultanate of Malacca. After the fall of Melaka to the Portuguese in 1511, the area became hotly disputed between the Portuguese, Johor, Aceh and Siam. After the Dutch displaced the Portuguese from Melaka, they brought in Bugis mercenaries from Sulawesi, (who established the current sultanate in 1740). In many districts, Bugis settlers displaced the Minangkabau settlers from Sumatra, who had established themselves in Selangor some 100 years previously. In the 19th century, the economy boomed due to the exploitation of huge tin reserves and the growing importance of rubber. This attracted a large influx of Chinese migrants. Chinese secret clan societies, allied with Selangor chiefs fought for control of the tin mines, and the increasing violence created social and economic havoc. It also opened a window of opportunity for the British, who forced the Sultan of Selangor to accept a British Resident at his capital of Klang in 1874. Under the stability imposed by the British, Selangor again prospered. In 1896, largely through the coordination of the Resident Frank Swettenham, Selangor united with Negri Sembilan, Perak and Pahang to form the Federated Malay States, with its capital in the Selangor city of Kuala Lumpur. The Federated Malay States evolved into the Federation of Malaya in 1948 and the Federation of Malaysia in 1963. In 1970, Selangor relinquished the city of Kuala Lumpur to the federal government. Putrajaya also became a federal territory in the mid-1990s.
Selangor currently is the richest, most industrialized and most urbanized of all the Malaysian states. The Menteri Besar of Selangor declared Selangor as a developed state on 27 August 2005.