The Pangkor Treaty was signed on 20th January, 1874 on the steamer HMS Pluto off the island of Pangkor, Perak, between Raja Abdullah Muhammad Shah of Perak and Sir Andrew Clarke on behalf of the British Government.
In Perak, prior to the signing of the Treaty, Chinese clans had been engaged in open warfare between themselves for years over their tin mining interests in which thousands died, to which was added a bitter succession dispute for the position of Sultan of Perak between Raja Bendahara Sultan Ismail and Raja Abdulla. Raja Abdulla, who had been overlooked but maintained he was the rightful successor, appealed to the British Government to support his claim to the throne, and to help him pacify the Chinese.
In his book About Perak, Frank Swettenham describes the situation which led up to the signing of the Pangkor Treaty which he calls “the Perak Engagement”,-
“Raja Abdullah, who was believed to be the rightful claimant of the throne of Perak, besought the assistance of the Governor of the Straits to introduce order in Perak, to control the Chinese, and to send him an experienced officer to aid him in administering the government of the country.”
The British led by Governor Sir Andrew Clarke agreed to meet him and requested the attendance of the Chinese clan leaders. He agreed to support all the requests of Raja Abdulla and both parties signed the Treaty.
According to Isabella Bird, traveller and diplomat, writing in The Golden Chersonese and the Way Thither (1880),-
Sir A. Clarke, thus appealed to, went to Pulo Pangkor, off the Perak coast, summoned the Chinese head men and the Malay chiefs to meet him there, and so effectively reconciled the former, who were bound over to keep the peace, that they were not again heard of. The Governor stated to the Malay chief and Abdullah that it was the duty of England to take care that the proper person in the line of succession was chosen for the throne. He inquired if there were any objection to Abdullah, and on none being made, the chiefs signed a paper dictated by Sir A. Clarke, since known as the “Pangkor Treaty.”
Swettenham also goes on to describe the other provisions in the treaty which effectively gave the British control of the State since the Sultan agreed to seek the advice of a British Resident whose advice must be followed on all matters excepting those of custom and religion. In addition, although acting in the Sultan’s name, the right to levy and to collect taxes was placed in the hands of the British.
“That treaty also provided for the the appointment of a British Resident and determined the nature of the authority he could exercise; it settled two boundary questions between the Colony and Perak, and secured peace between the contending factions of Chinese.” 
Two clauses in the Treaty virtually placed the administration in the hands of the British,-
“Clause VI. That the sultan receive and provide a suitable residence for a British Officer to be called Resident, who shall be accredited to his Court, and whose advice must be asked and acted upon on all questions other than those touching Malay religion and custom.
And
“Clause X. That the collection and control of all revenues and the general administration of the country be regulated under the advice of these Residents.”
On the steamer HMS Pluto off the island of Pangkor, Perak, with Raja Abdullah of Perak and Sir Andrew Clarke (Source: National Museum)
According to the terms of the Treaty, Raja Abdullah would be recognised as the legitimate ruler of Perak in return for accepting a British “Resident” who would be consulted on by the Raja on all matters relating to the state except for local custom and religion.
However Swettenham points out that mistakes were made by the British following the signing of the treaty because they underestimated the resentment that their interferance would cause especially among the local chiefs whose power and privileges were jealously guarded :- “There was regrettable delay in the sending of a Resident to Perak and the difficulties of the problems were not understood, as indeed it was hardly likely they would be.”
It had a large Malay population, people whose ancestors had for generations belonged to the place and who were saturated with ancient customs, prejudices, and superstitions that had to be learned, and many of which it was difficult to sympathise. It had an unusual number of Rajas and Chiefs, each with some kind of privilege or vested interest.”
The Pangkor Treaty signed in 1874 (Source: National Museum)
The Treaty of Pangkor marked the official introduction of Residency system in Malaya.
The first Resident appointed in Perak was J.W.W Birch but due in part to his insensitive interference in local affairs he was assassinated in 1875.
Swettenham described the killing of J.W.W Birch as a political assassination and not arising from personal animosity,-
“Of his kindness to the Malays there are many who will speak and his assassination at Paser Sala was a political murder in which there was no semblance of personal feeling.”
He points out that Birch’s death turned out ultimately to the benefit of Perak as subsequent events proved,-
“The loss of his valued life was an infinite gain for Perak, for the considerable military expedition which followed, and the subsequent short occupation of the State by British troops did more to secure permanent tranquillity than ten or fifteen years of “advice” by a British Resident.”