 From 1819 to 1822 he was an aide to John Brooks, the Governor of Massachusetts.He became brigadier general of militia in 1823, and from 1820 to 1825 he served in the State Legislature,

In 1833 Lyman defeated William Sullivan, the Whig candidate, and was elected the first Democratic Mayor of Boston.He served for two years from January 1834 through January 1836.