His real name was Iman Rasu bin Shahrum and he was the 'Imam Perang' laterally translated as the leader for wars, may the term chief of army will suit him.
His early involvement in the political struggle was during the civil war. Pahang was the ruled by Bendahara, the like of Chief Minister. There was not Sultan or King for Pahang. When the Bendahara Tun Ali died in 1857, his elder son, Tun Mutahir (nothing to do with Tun Mahathir) was announce as the rule. According to the will of his father, the younger should be given the right for the taxes for Kuantan. However, instead of Kuantan, Wan Ahmad, the younger brother was given rule over Rompin.
This had caused Wan Ahmad to revolt, he was supported by tok gajah dan Tok Raja, the chief in Kuala Lipis. During the war Wan Ahmad was away in Terengganu. In the initial battles, the forces of Wan Ahmad was in the losing side. However the tide changed when Wan Ahmad returned to Pahang. The route took him from ulu Terengganu to Ulu Tembeling. When Wan Ahmad had won, he became the ruler of Pahang, and Tok Gajah was made the General in charge of the army.
When the British managed to influence Wan Ahmad to accept the presence of British, Tok Gajah was fighting against the British and the forces of Wan Ahmad. That time Tok gajah was considered as a traitor, because he was raising an army against the ruler of Pahang. However, now Tok Gajah is accepted an a hero fighting the British who had made Wan Ahmad as nothing but a living puppet.
In fact that seem to be modus operandi of the British to colonize Malaya. The same method is used now to control the Muslim nations in Middle East. It does not cost much to tame a lion and put a chain around his neck, when we know that the lion is controlling millions of sheeps.
He was one of the leaders that revolted again the British and the sultan on one side and the freedom fighter on the other side, in the Pahang war in 1893 - 1895. He passed away at the age of 56 in 1901 at Kampung Pasir Nering, 8 km from Kuala Berang.