On returning to Kabul, Lawrence became political assistant to Sir William Hay Macnaghten, the envoy of Afghanistan, and subsequently his military secretary, a post which he kept from September 1839 to the death of his chief. On the surrender of Dost Mahomed Khan, 3 November 1840, he was placed in the charge of Lawrence until he was sent to Calcutta. In the revolution at Cabul, in November 1841, Lawrence had many narrow escapes of his life, and on the surrender of the troops, he was one of the four officers delivered up on 11 December 1841 as hostages for the performance of the stipulations. On 23 December, when Macnaghten and others were treacherously murdered by Akbar Khan, he was saved by the interposition of Mahomed Shah Khan. In the retreat from Kabul, 6 January 1842, Lawrence had charge of the ladies and children, with whom he remained until 8 January, when he was again given up to Akbar Khan as a hostage. With the ladies and children, he was imprisoned and remained with them until their release on 17 September 1842. He owed his safety during this period to the high opinion which Akbar Khan had of his character, and to his strict adherence to all the promises which he made to his captor. Ill-health obliged Lawrence to return to England in August 1843, and shortly after that date the East India Company awarded him £600 in testimony of their sense of his services in Afghanistan.
On his going back to India in October 1846, he was appointed an assistant political agent in the Punjab, having charge over the important Rajputana district. In the autumn of 1847, with only two thousand troops, Lawrence engaged and defeated on two occasions large numbers of the hill men of the tribes on the Swat border. On the breaking out of the second Sikh War in 1848, Lawrence's great personal influence at Peshawar for some time kept his regiments faithful, but at last they went over to the enemy, and, on 25 October 1848 he was a prisoner in the hands of Chuttur Singh, but was three times permitted to leave his captivity on parole. With his wife and children, he was released on 22 February 1849, in the peace following the Battle of Gujrat, and received the thanks of both houses of parliament and of the governor-general for remaining at his post with such devotion. On 7 June 1849, he was promoted to be brevet lieutenant-colonel and appointed deputy commissioner of Peshawar. The following November, in the capacity of political officer, he accompanied the forces sent under General Bradshaw into the Yusufzai country and was present at the capture of Pullee on the Swat border. Again in February 1850, in command of militia, he went with Sir Charles Napier to the forcing of the Kohat pass and guided him through that defile. In July 1850 he became political agent in Méwar, one of the Rajputana states, where he remained until 13 March 1857, when he succeeded his brother Henry Lawrence as resident or chief agent for the governor-general in the Rajputana states, and in April took up his residence in Abu. On the breaking out of the Indian rebellion of 1857 he was named brigadier-general of all the forces in Rajputana, and on the death of Colonel Dixon on 12 June 1857, he took chief military command. By his vigorous and decided action the arsenal of Ajmer was retained; a proclamation confirmed the native princes in their loyalty, and the Rajputana states were prevented from joining the revolt. Such outbreaks as did take place were successfully quelled, first by himself, and afterwards by Major-General Roberts.
Retirement and later life
Up to this date Lawrence had received no decoration beyond the medals for the Punjab and Indian campaigns, but on 18May 1860 he was created a Companion of the Bath. On 25May 1861 he was gazetted major-general, and in December 1864 resigned his post in Rajputana thereby ending his Indian career after forty-three years service. Both Sir Charles Napier and Lord Dalhousie had expressed their high regard for his character and achievements. "He is a right good soldier," said the former, "and a right good fellow, and my opinion of him is high." On 11January 1865 he received a good-service pension of £100 a year; and on 24May 1866 was created a Knight Commander of the Order of the Star of India. He also held the third class of the order of the Dooranee Empire. He retired from the army on full pay on 29October 1866 and was advanced to honorary lieutenant-general on 11January 1867. He died at 20 Kensington Park Gardens, London, on 16November 1884, aged 80.
Personal life
Lawrence married Charlotte Isabella, daughter of Dr. Benjamin Browne, on 3 April 1830. She died on 12 May 1878, having borne him three sons and six daughters.
Memoir
Lawrence wrote a memoir, Forty-three Years in India, which was published in 1874, a decade before his death.