Williams was a member of the
Massachusetts House of Representatives from 1819 to 1823. In 1827, Williams served in the
Massachusetts Senate. Williams was a longtime friend and supporter of
John C. Calhoun. Once
Andrew Jackson's victory in the
1828 United States presidential election became certain, Williams publicly claimed Calhoun's friendship and joined the Jacksonians. During the campaign for the appointment, Williams and Freeman came to blows on the street. Williams served as collector for 8 years. The
New Bedford Customhouse was constructed during Williams's time in office. From 1844 to 1845, Williams served as collector of customs at the port of Boston. In 1850, Williams condemned
Daniel Webster's "Seventh of March" speech and defended slavery on biblical grounds. ==Later life==