Back to


The Selangor Civil War

The Battle for Kuala Lumpur


Selangor Police and European officer, circa 1880.

At the beginning of May 1872, Raja Asal and Raja Laut with a force of 2,000 Malays marched from Kajang to Petaling Batu (what is today modern Chan Sow Lin on the Sungai Besi Road) where they camped and started constructing defensive stockades. This was just three miles from Yap Ah Loy's camp. It was only at this point that Yap Ah Loy had learned of Raja Asal's defection to the enemy. The bulk of Yap Ah Loy's forces, together with his Malay allies under Imam Perang Mat Akil, were up 35 miles to the north in Ulu Yam and Rawang - blocking any attack from Syed Mashhor's forces in Ulu Selangor. At Kuala Lumpur, he only had about 200 troops, including 80 sepoys and about 20 European and Eurasian non-commissioned officers under the command of a Dutchman van Hagen and an Italian, Cavalieri.

Yap Ah Loy very rapidly recruited more mine workers and local Chinese to reinforce his forces in Kuala Lumpur. He placed 2,000 men under van Hagen's command and ordered him to attack Raja Asal's forces in Petaling Batu and destroy them before their stockades were completed. Van Hagen's and Raja Asal's forces bitterly fought on a frontline just beyond the Kwong Tong Chinese cemetery in Bukit Petaling, the oldest in Kuala Lumpur, and the battle lasted for three days. Despite suffering heavy casualties, Van Hagen failed to dislodge Raja Asal's forces and he was forced to retreat back to Kuala Lumpur. Yap Ah Loy's situation was now desperate. He sent an urgent message back to Chung Piang and Imam Perang Mat Akil, asking them to withdraw with all haste from Ulu Yam and fall back to his camp at Kuala Lumpur. As their forces retreated, Syed Mashhor's forces left their stronghold in Kuala Kubu and harried Chung Piang's rearguard as they retreated. Small units were left in Rawang and Kanching to slow Raja Mashhor's advance but these were rapidly overwhelmed and destroyed by the superior numbers of the surging enemy.


Syed Mashhor's forces reached the western outskirts of Kuala Lumpur west of the Gombak and Klang rivers and soon linked up with Raja Asal's and Raja Laut's forces on the southern and eastern boundaries of the town. Kuala Lumpur was now surrounded on three sides.  It was at this point that yet another defection was to occur - the leader of the Mandailing Malays, Sutan Puasa, now declared his allegiance to the Raja Mahadi camp. He constructed his stockades on a hill overlooking Yap Ah Loy's positions and linked his forces up with Syed Mashhor's. Pineapple trees were planted on the slopes of the hill - the sharp thorns of the leaves were meant to deter any attackers approaching the stockades, particularly if they were barefoot. This was what gave the hill its name - Bukit Nanas. Tunnels were also dug as part of the defences.

Yap Ah Loy now arranged his defensive lines in the form of a crescent surrounding his headquarters at what is now Medan Pasar in Kuala Lumpur. His right flank of the 'crescent' along the eastern banks of the Gombak river was commanded by himself, while the left flank on a line following the western bank of the Klang river was placed under Van Hagen's command. He maintained an open communications and supply line with his allies in Klang, using the road to Damansara and Sungai Pencala on his left flank. At the beginning of July, Raja Mahdi and several other Selangor chiefs marched with their forces from Lukut and joined Syed Mashhor's besieging forces. They agreed that Yap Ah Loy's supply line to Damasara had to be cut and launched an attack Batu and Gombak with 300 men. Villages along the left bank of the Gombak River were burned and the western approaches to Damansara blocked. Yap Ah Loy lost his lifeline to Klang.


The bridge over the Klang River at Java Street (now Jalan Tun Perak)

Both sides of the conflict in the Selangor Civil War introduced a new military innovation to improve the fighting spirit of their men and reward them for bravery - money was paid for the heads of slain enemy troops. The reward for cutting down the head oî a leader $100 and $10 for an ordinary soldier. This initiative proved so popular that they were so many heads collected there was scarcely sufficient time for giving rewards.

By the beginning of August, Yap Ah Loy and van Hagen were seriously running out of supplies - nothing was coming through from Klang. Fighting was also occurring on a daily basis and they soon realised that they did not have enough troops to both hold their line and open a new supply line to Klang. It was at this point that van Hagen concluded that the situation was hopeless and decided to cut his way through the enemy's lines and try to make his way to the coast. an Hagen left that night, taking only 100 of his sepoys and non-commissioned officers, and leaving Yap Ah Loy and the remainder of the troops in Kuala Lumpur. Moving along the path of Sungai Kuyoh, his force reached Sungai Besi and found their way blocked by a contingent of Raja Asal's Malays. The two forces exchanged fire and soon other Malays from Petaling Batu pursuing van Hagen arrived and he found himself being attacked from the rear as well. Van Hagen's detachment was practically wiped out - 66 of his 100 men were killed, including his Italian second-in-command Cavalieri. Van Hagen himself was captured and executed in Kuala Lumpur the next day.

Yap Ah Loy, in the meantime, saw that the majority of the Malay forces were in pursuit of van Hagen's detachment and, when night fell, ordered his troops to take to the jungles in the direction of Damansara. After Syed Mashhor's men returned from destroying van Hagen's detachment, they returned to find Kuala Lumpur undefended and proceeded westwards in pursuit of Yap Ah Loy's men. After traveling for two days and two nights in thick jungle, Yap Ah loy finally reached Damansara and the road to Klang. During the retreat, he had lost over 1,700 men to his pursuers, including many of his close captains and associates.


Kuala Lumpur had fallen. Ironically, Kuala Lumpur may not have fallen if Yap Ah Loy's forces had held on for a few more days - help was already on its way. At the request of Tunku Kudin, the Raja Bendahara of Pahang Tun Ahmad had already dispatched a force of Pahang Malays to Kuala Lumpur to help lift the siege. An advance force of 1,000 Pahang Malays departed from Bentong and had already reached Kepong the day Van Hagen made his dash for the coast. The Pahang Malays had already beaten off an attack by 200 of Raja Asal's men and sent word to van Hagen to make for Kepong and join them. For whatever reason, van Hagen chose to ignore the message and, finding the town abandoned by its defenders, the Pahang Malays withdrew back to their base in Bentong..

For more images, see www.facebook.com/media/set/?set=a.10154808491797988


About the Author

Write to the author: sabrizain@malaya.org.uk

The Sejarah Melayu website is maintained solely by myself and does not receive any funding support from any governmental, academic, corporate or other organizations. If you have found the Sejarah Melayu website useful, any financial contribution you can make, no matter how small, will be deeply appreciated and assist greatly in the continued maintenance of this site.