Yancey was elected to the 13th United States Congress in 1812 and re-elected in 1814 to the 14th Congress, serving from March 4, 1813 to March 3, 1817. During both terms, he chaired the Committee on Claims. Refusing to run for Congress again in 1816, Yancey instead ran for the North Carolina Senate and served there for ten years, from 1817 to 1827; he presided over the Senate during his time in the state legislature. He died near Yanceyville in 1828 and is buried in his family cemetery.