Nelson was elected as a Democratic-Republican to the Twelfth and to the five succeeding Congresses and served from March 4, 1811, until his resignation on January 14, 1823, having received an appointment in the diplomatic service. He served as chairman of the Committee on the Judiciary (Fourteenth, Fifteenth, and Seventeenth Congresses). Nelson was appointed by President James Monroe as United States Minister to Spain on January 15, 1823, and served until November 23, 1824.
Nelson died at his home, "Belvoir," Albemarle County, Virginia, March 18, 1836. He was interred in Belvoir Cemetery, Cismont, Virginia.