Malcolm was again sent to Iran in 1810, but by that time the British government had decided to conduct diplomatic relations with Iran directly from London, and appointed Sir Gore Ouseley as ambassador. In 1812 Malcolm returned to Britain for five years’ furlough, and spent much of his time as a writer, completing his "History of Iran" (the first in English derived directly from Iran sources) in 1815. For this he received an honorary DCL from the University of Oxford. Returning to India in 1817, he acted as the Governor-General's agent in negotiations leading up to the third (and last) Anglo-Maratha war. He also acted as a general, leading Company troops to victory against Maharajah Holkar at the decisive battle of Mehidpoor (Mahidpur) in December 1817. In January 1818, Malcolm was placed by the Marquis of Hastings in the military and political charge of Central India (roughly, today's Madhya Pradesh); during the four years he filled that station, his attention was directed to the object of collecting materials for the illustration of its past and present condition. The report hereof he sent to Calcutte, where it was printed by order of Government. Disappointed to being superseded for the governorship of Bombay and Madras by his juniors, Malcolm left for Britain in 1822, where he lived with his family as a country gentleman, completing two more books. In 1827 he was appointed Governor of Bombay. His governorship was generally successful, despite controversy over an unfortunate quarrel with the judges of the Bombay Supreme Court, who sought to extend their jurisdiction beyond Bombay to the Deccan hinterland, newly acquired by the Company from the Maratha Peshwa of Poona. In seeking to end both sati (the self-immolation of widows on their husband's funeral pyres) and female infanticide by moral persuasion, Malcolm visited Gujarat in February 1830 and met Sahajanand Swami, the founder of the Swaminarayan sect of Hinduism, who was advocating similar reforms. He has ever since been remembered in Swaminarayan literature. Together with his predecessor, Mountstuart Elphinstone, he was a pioneer in the promotion of Indian education and the training of Indians for the higher ranks of government. He also served as president of the Literary Society of Bombay  In 1831 Malcolm finally returned to Britain, and immediately became a Member of Parliament for the rotten borough of Launceston, supporting his friend the Duke of Wellington in opposition to the Reform Bill.