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 Mahdi. 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, the Tunku Kudin side, with support from Pahang fighters, defeated Mashhor and recaptured Kuala Lumpur.