Sultan Muhammad died in 1857, and Sultan Abdul Samad took the throne after a power struggle. Sultan Abdul Samad however only controlled Langat, then the state capital, and did not have absolute control over the rest of Selangor, which was then ruled by four chieftains in Bernam, Lukut, Klang and Kuala Selangor. When the disgruntled Raja Mahdi initiated the conflict, the Malays would split into two camps in the ensuing war. On Raja Mahdi side were Raja Mahmud, son of the Panglima Raja of Selangor; Raja Hitam of Bernam; groups of Sumatran settlers led by Mohamed Akib and his younger brother Mohamed Tahir (was later conferred the title of 'Dato Dagang'). Raja Abdullah's faction included his son, Raja Ismail who continued the war after Raja Abdullah's death, later joined by Tengku Kudin and supported by the Sultan of Selangor. The Chinese tin miners were also divided between the two camps.