Ashmun was born in Blandford, Massachusetts to Eli P. Ashmun and Lucy Hooker. He graduated from Yale in 1823 and was married to Martha E. Hall in 1828. He served in the Massachusetts House of Representatives from 1833 to 1837, and the Massachusetts Senate from 1838 to 1840. In 1841, he returned to the Massachusetts House where he served as Speaker.
Ashmun was elected to the U.S. Congress from the Sixth District of Massachusetts in 1844, held office from 1845 to 1851 and was a member of the committees on the judiciary, Indian affairs, and rules. He opposed the Mexican-American War, and was a strong supporter of Daniel Webster.
After leaving Congress, Ashmun moved to Springfield, Massachusetts where he spent the rest of his life practicing law in the firm Chapman & Ashmun, founded with Reuben A. Chapman. There he met newspaper publisher Samuel Bowles (journalist), with whom he helped to found the U.S. Republican Party. Immediately, Ashmun joined the Republican Party, and presided over the Republican Party's convention in 1860 that nominated Abraham Lincoln for President.