Yap Ah Loy arrived in
Lukut in 1856 at the age of 19. He spent his early years in the peninsula as a miner and petty trader, but in 1862 his fortunes improved when his friend
Liu Ngim Kong () succeeded
Hiew Siew (Chinese: 丘秀) to become the second
Kapitan Cina of Kuala Lumpur, a position not only of leadership within the Chinese community, but also of liaison with the Malay political system and, after British intervention in 1874, with British officials as well. He became Liu's trusted lieutenant and succeeded him as the third Kapitan Cina of Kuala Lumpur after Liu's death in 1869, after which he began to put together a sound administration and a strong fighting force. Yap's appointment however was challenged by the "relatives" of Liu, and a group opposed to Yap emerged under the leadership of Chong Chong. There were also constant warfare between two Chinese gangs, the Hakka-dominated
Hai San (dominant in Kuala Lumpur) and the Cantonese-dominated
Ghee Hin (based mainly in the
Kanching and
Rawang area), who fought to gain control of tin production in the town. At Kanching, an ally of Yap Ah Loy, Yap Ah Sze, was ambushed and murdered, probably at the instigation of Chong Chong, another Hakka headman. Yap Ah Loy then took his men to Kanching to drive out Chong Chong in 1870, and 12 Chinese and 8 Malays were killed in what would become known as 'the Kanching Massacre'. Chong Chong then fled to Rawang and joined Raja Mahdi's faction in the
Selangor Civil War that broke out earlier in 1867. Yap Ah Loy sided with Tunku Kudin in the civil war, and Kuala Lumpur was attacked in 1870 by Yap's enemies who sided with
Raja Mahadi. A further attack was attempted, and in 1872, Raja Mahdi's forces led by
Syed Mashhor captured Kuala Lumpur, forcing Yap Ah Loy to flee to Klang. Yap attempted to retake Kuala Lumpur, and in March 1873, Tengku Kudin's faction, with support from Pahang fighters, defeated Mashhor and recaptured Kuala Lumpur. Yap's victory at Kuala Lumpur in 1873 placed him in a strong political position, and he was almost supreme in the interior of the state. However, Kuala Lumpur was gutted during the war and the mines flooded. Yap then set about rebuilding the town and rejuvenating the mining industry. He also improved the roads linking Kuala Lumpur with adjacent mining areas and other settlements. A slump in tin price mid 1870s however caused severe financial difficulties. He started a brick-making venture at
Brickfields, as well as a tapioca plantation although that proved a costly failure. By the late 1870s he was in considerable debt and said to be almost bankrupt. However, a rise in the price of tin in 1879 improved his financial position as well as securing the future of Kuala Lumpur. Yap's achievement in the postwar recovery of the mining industry established Kuala Lumpur as the economic centre of the peninsula. As the acknowledged leader of the Chinese community, he was given the powers similar to a Malay ruling chief by the British, except for the right to tax, a restriction he easily evaded. Through his control of the tin market and his diverse business interests, he amassed a considerable personal fortune. In 1879, the first British resident (government advisor) was assigned to Kuala Lumpur, and from that time the power of the
Kapitan began to be undermined. None of Yap Ah Loy's successors approached his power and independence of action. In 1884, Yap Ah Loy planned a visit to China, intending to appoint
Yap Ah Shak and
Chow Yuk to manage his property in his absence. For some reason the plan was never carried out. On 1 September that year, a violent storm struck the Klang Valley, causing widespread damage to property in Kuala Lumpur. The storm blew down 14 houses and a wing of the newly built Police barracks, as well as the barrack's residential area and the flagstaff. == Developer of Kuala Lumpur ==