A History of the Malay Peninsula


Back to


Golden Chersonese

Portuguese Conquest


The Johor Empire


Dutch East India


The Straits Settlements


The Kedah Blockade


The Selangor Civil War


The Perak War

Forward to


British Malaya

The Selangor Civil War

 The Bugis established themselves in Selangor in the eighteenth century and set up one of their leaders, Raja Lumu, as its first Sultan, with the title Sultan Salehuddin Shah.  The second Sultan, Ibrahim, joined forces with his uncle, Raja Haji, in the Bugis attack on Dutch Malacca in 1784 and helped Perak defeat a Siamese invasion.

However, with the death of Sultan Ibrahim in 1826, Selangor fell on evil days. Sultan Muhammad, the next ruler, was unable to control his chiefs, who actively engaged in piracy. Between intervals of comparative quiet, said Swettenham, in his book 'British Malaya', the "normal state of Selangor was robbery, battle and murder". With the death of Sultan Muhammad in 1857, there was a disputed succession, and Abdul Samad, who eventually became Sultan, had all but given up the struggle to maintain order.

In 1867 Civil war broke out in Selangor.  It originated from an attempt by Raja Mahdi, the son of a territorial chief, to gain control of the Klang river estuary into which the cargoes of tin from around Kuala Lumpur arrived for export. He gained the support of Sumatran Malays in the hinterland of Selangor who felt no loyalty towards the Bugis chiefs - a hostility which had been maturing for generations - and Raja Mahdi and his Sumatran Malays captured the town of Klang.

Into this chaotic scene in 1868 came a visiting Kedah prince, Tengku Kudin, brother of the ruler of Kedah.  He married Sultan Abdul Samad's daughter, was appointed "Viceroy" of the state and was handed the responsibility of administering it on behalf of the Sultan.  Tengku Kudin’s 500 Kedah warriors joined the Sultan’s mixed force of Bugis and Chinese led by European mercenaries and attempted to recapture Klang.

Raja Mahdi was a colourful warrior, renowned for his courage and was at the head of all the Malays considered the chivalry of Selangor.  Tengku Kudin, on the other hand, was an unpopular ‘foreigner’, with a following of foreigners and no local allies.  However, the ‘foreigner’ was a determined, single-minded man with a fund of perserverance that none of his rivals possessed.  He sat down before his enemy's fort at Klang, blockading the river so efficiently that neither food nor tin entered the town. He did not attempt to carry it by assault but simply threatened it and worried it for eighteen weary months – starving it of supplies and ruining its trade with the interior.  The theatrical valour of Raja Mahdi was no match for such persistence -  Raja Mahdi’s money ran out; his storehouses emptied; his followers began deserting him. In March 1870, Raja Mahdi was forced to retreat to Kuala Selangor, where began to menace the strong fort which the Sultan was holding at the mouth of the river. 

Tengku Kudin dispatched powerful reinforcements to the fort under the leadership of one of the Sultan’s warriors, Saiyid Mashhur. However, at Kuala Selangor, Saiyid Mashur received news that his brother had been killed in circumstances that led him to believe that members of the Sultan’s family were responsible. The Saiyid vowed vengeance and at once went over to Raja Mahdi’s forces.

As in Perak, the Chinese tin-miners brought their quarrels to add to the general confusion. The Chinese were the source of most of the state’s wealth and the rival Malay chiefs sought alliances with the leaders of the various Chinese warring factions to gain control of key tin-mining areas. The most notable of these leaders was Yap Ah Loy, who had founded the town of Kuala Lumpur. He took the side of the Tengku Kudin, and tried to maintain some kind of order with a private army of fighting men.

Immediately after the Pangkor Agreement was signed with Perak, Sir Andrew Clarke turned his attention to Selangor and visited the State with the Admiral of the British China squadron to get redress for a bad case of piracy -  the plunder of a junk and the slaughter of 34 persons (many of them women and children) by pirates based in Raja Mahdi’s and Saiyid Masshur’s stronghold in Kuala Selangor.  On the 3rd of July 1871, the HMS "Rinaldo" and the colonial steamer "Pluto were despatched to Kuala Selangor. The "Rinaldo" was lying outside the estuary but the "Pluto" had entered the river towing boats full of British Marines.  Two parties of Marines went ashore but were fired upon by the Malays. The British retreated to their ships, with one Marine killed and five wounded and the "Pluto" steamed out of the river and went on to Penang to transport their wounded. 

On the following day, the Rinaldo shelled the fort with tremendous effect, driving Saiyyid Mashhur and his followers into the surrounding jungle. The British handed Kuala Selangor over to the charge of the Tengku Kudin, who garrisoned it with 100 Sikhs and some 30 or 40 Kedah Malays. This incident prompted a demand from the British that Sultan Abdul Samad agree to the trial of the pirates and accept a British officer to advise him, as was the case in Perak. The Governor did not appoint a Resident for some time, but he left behind at Selangor court a young Civil Servant named Frank Swettenham to give informal advice and to gather information.

Swettenham was to play a great part in Selangor and all Malaya.  Swettenham skilfully won the friendship of the Sultan and prominent chiefs and restored order by the creation of a small but efficient police force. Swettenham made his head-quarters at Kuala Lumpur, which thus became the administrative capital of the state. With peace and order there was soon a surplus of revenue, which Swettenham used to improve communications - building a system of cheap bridle to all parts of the state and constructing a railway from Klang to Kuala Lumpur. Gradually, other departments of government were set up. European coffee planters began to arrive from Ceylon, where a blight had destroyed their plants. Although coffee did not prove profitable in the long run, many of these planters turned to rubber instead – Malaya was to become the world’s leading producer of rubber for the next century.

By 1889, when Swettenham went to take the place of Sir Hugh Low in as Resident in Perak, Selangor was well on the road to prosperity – and becoming an established part of the British colonial system in Malaya.

The Battle for Klang

The Malay chiefs grapple for power


The Battle for the Tin Mines

Chinese rivals take sides


The Battle for Kuala Lumpur

Raha Mahadi's allies victorious


The Selangor Incident

Selangor succumbs to gunboat diplomacy


Bombardment of 'Salangore'

The Illustrated London News account


Saiyid Mashhur

Silhouette of 'a man of war'


Frank Swettenham

Architect of British Malaya


Kota Kuala Selangor

Selangor's twin guardians


The Lukut Massacres

Selangor loses 'an enlightened Rajah'


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.