After Eton and Haileybury, Lyall joined the Indian Civil Service in 1856, and served a long career in India. He landed at Calcutta in January 1856. After four months of training he was posted as an Assistant Magistrate at Bulandshahr in Doab, a part of the North-West Provinces. He was there when the Indian Rebellion of 1857 occurred: his house was burned down and he was nearly killed when fleeing as his horse was shot from under him. He joined the Khaki Risala of Volunteers, an irregular European cavalry unit. He helped "pacify" Bulandshahr. In May 1858 he was transferred to Shahjehanpur where he helped "restore order". In April 1861 he returned to England for about eighteen months. On his return to India he was appointed Assistant Magistrate at Agra. In 1864 he was appointed district manager of Nagpur at Hoshungabad in the Central Provinces, before being appointed commissioner in Berar in 1867. He was now earning £3000 a year. He went on to become Home Secretary to the Government of India in 1873 and the governor-general's agent in the state of Rajputana the following year. His next post was as Foreign Secretary to Government of India from 1878 to 1881. He was then appointed Lieutenant-Governor of North-West Provinces, and Chief Commissioner of Oudh from 1882 to 1887. He also founded the University of Allahabad and became its first chancellor. He was made an honorary fellow of King's College, Cambridge in 1893. He was made a member of the Privy Council in 1902, having served on the India Council from 1888 to 1902. Lyall's ideas regarding the development and organisation of society in India were developed principally during the time he spent working in the Central Provinces, Berar and Rajputana between 1865 and 1878. He was, in the opinion of Crispin Bates, "one of the more programmatic of nineteenth century writers on Indian history" and his writings on the subject are "somewhat dubious". Another historian, Clive Dewey, believes that
His Verses Written in India was published in 1889. He wrote a number of other books on poetry. He wrote also books on Indian history, Warren Hastings, and Alfred Lord Tennyson. His literary achievements brought him advanced degrees, a D.C.L. from Oxford and an LL.D. from Cambridge, an Honorary Fellow of King's College, Cambridge, and membership in the British Academy. A more comprehensive list of his known publications is given below:
Asiatic Studies, Religious and Social: First Series.
The Rise and Expansion of the British Dominion in India.
Warren Hastings.
Verses Written in India.
Asiatic Studies: Religious and Social in India, China & Asia: Second Series.