He did not meet with much success in Kabul and came to Lahore to take up service under Maharaja Ranjit Singh on an oath of fealty in the name of Christ.He also promised, in writing, to serve the Maharaja honestly all his life and fight against his enemies. He also volunteered to keep supplying news about the British as well as about the Afghans. Maharaja Ranjit Singh appointed him governor, on a salary of Rs 1,000 per month, of the provinces of Jasrota and Nurpur, two districts then newly annexed to Lahore. In 1832, he became governor of Gujrat.
In 1835, during the Peshawar campaign, Harlan and Faqir `Aziz udDin were Sikh envoys sent to Dost Muhammad`s camp for negotiations, a duty they performed at great personal risk. Dost Muhammad had both of them interned with the intention of bargaining for Peshawar.But their lives were saved by Sultan Muhammad Khan, Dost Muhammad`s disgruntled brother. Harlan, however, could not retain Maharaja Ranjit Singh`s favour for long.
According to Sohan Lal Sun, the court historian, Harlan was summoned to attend on Maharaja Ranjit Singh when he had an attack of paralysis of the tongue. Harlan, it is said, mentioned a fee of a lakh of rupees which was readily agreed to, but when Harlan insisted on money being paid beforehand, the Maharaja was beside himself with rage and gave orders that he be stripped and put across the Sutlej, which was done. In order "to avenge myself and cause him [Ranjit Singh] to tremble in the midst of his magnificence," Harlan entered, towards the end of 1836, the service of Dost Muhammad who gave him command of his regular troops.It is said that it was at Harlan`s instigation that Dost Muhammad had declared war against Ranjit Singh culminating in the battle of Jamrud in April 1837.
Although the celebrated General Hari Singh Nalva was killed in this battle, the Afghans had to retreat without any gain. In 1839, when the army of the Indus approached Kabul, Harlan was deputed to negotiate with the mission headed by Sir Alexander Burnes. As the British forces reached Kabul, Dost Muhammad fled to the mountains, and Harlan quickly shifted over to the British. Thereafter, he left Afghanistan for India from where he proceeded to Philadelphia. Back home, Harlan settled down to a quiet life.
He published an account of his adventures, A Memoir of India and Afghanistan. He died in San Francisco in October 1871.
1. Grey, C., European Adventurers of Northern India [Reprint]. Patiala, 1970
2. Suri, Sohan Lal, `Umddt-ut-Twdnkh. Lahore, 1885-89