Larut War was a series of four wars started in July 1861 and ended with the signing of the Pangkor Treaty of 1874. The conflict was fought among local Chinese secret societies over the control of mining areas in Perak which later involved rivalry between Raja Abdullah and Ngah Ibrahim.
The First Larut War began in July 1861 when arguments over control of watercourse to their mines escalated and led members of the Hai San Society to drive the members of the Ghee Hin society out of Klian Baharu (now known as Kamunting). The Governor of Straits Settlements, William Orfeur Cavenagh intervened and the Mentri of Larut, Ngah Ibrahim, was made to compensate the Ghee Hin with $17,447 on behalf of the Sultan of Perak.
The Second Larut War took place in 1865 and was sparked off by a gambling quarrel in June of that year between members of the two opposing secret societies. The Hai San members took 14 Ghee Hin as prisoners, 13 of whom were killed. The 14th escaped to inform his clan and the Ghee Hin retaliated by attacking a Hai San village, razing it to the ground and killing 40 men in the process. The battle continued back and forth and spread to Province Wellesley and the island of Penang while other secret societies started to join the fray. Both sides were later exhausted and finally decided to come to terms. An official inquiry took place and both the Hai San and Ghee Hin societies were fined $5,000 each for violating the peace of Penang and their leaders exiled.
By around 1870, there were a combined total of about 40,000 Hakka and Cantonese mine workers in the Larut district and the mining areas between the two groups were near to each other. It is this proximity that might explain how the next battle began.
The Third Larut War was rumoured to have erupted in 1871 over a scandal - an extra-marital relationship involving the Ghee Hin leader and the wife of a nephew of the Hai San leader, Chung Keng Quee. Upon discovery, the adulterous couple was caught, tortured, put into a pig basket and thrown into a disused mining pond where they drowned. Avenging the death of their leader, Ghee Hin had 4,000 mercenaries imported from mainland China via Penang attack the Hai San and for the first time, the Hai San were driven out of Larut. About 10,000 Hai San men sought refuge in Penang. Months later, the Hai San supported by Ngah Ibrahim recovered their Matang and Larut mines. At this time, Raja Abdullah a claimant to the throne of Perak and an enemy of Ngah Ibrahim, took sides against the Hai San and Ngah Ibrahim and the wars between the Chinese miners transformed into civil war involving the Malay chiefs of Perak.