As a civil servant in India (1834–38) he established an English system of education and devised a new criminal code, before returning to Britain and devoting himself to literature and politics. Among his best-known works are The Lays of Ancient Rome (1842) and his History of England (1849–61), which covers the period from the accession of James II to the death of William III from a Whig standpoint.