Lockwood was elected as a Democrat to the 43rd United States Congress, and served from March 4, 1877, to March 3, 1879. He was a delegate to the 1880 and 1884 Democratic National Conventions. In 1884, he nominated Grover Cleveland, his closest friend, for President. Lockwood was appointed the United States Attorney for the Northern District of New York by President Cleveland, and served from 1886 to 1889.