A special election was held in Massachusetts's 20th congressional district (in the District of Maine) on March 16, 1818 to fill a vacancy left by the resignation of Albion K. Parris (DR) on February 3, 1818 after being named a judge of the United States District Court for the District of Maine.
Electoral results
Lincoln took his seat on November 16, 1818 and would continue to serve in the 16th, 17th (for Maine's 7th district after the separation of Maine), the 18th and part of the 19th Congress (the later two Congresses for Maine's 5th district after redistricting)
References
Massachusetts's 20th congressional district special election, 1818 Wikipedia(Text) CC BY-SA