A special election was held in was held on September 11, 1826, to fill a vacancy caused by the resignation of Enoch Lincoln (A) in January, having been elected Governor of Maine. As a majority was not achieved on the first ballot, a second election was held November 27.
Ripley took his seat December 4, 1826. With his election, the 5th district changed from Adams Party control to Jacksonian control.