During the 1884 Presidential election, Warfield made significant contributions to the campaign of the 22nd (and later also 24th) President Grover Cleveland in Maryland, the first Democratic president to be elected since before the Civil War. Following the election, Cleveland appointed Warfield to serve as Surveyor of the Port of Baltimore beginning April 5, 1885. Warfield served in that position until May 1, 1890, after the Republicans returned to power. In 1890, Warfield married Emma Nicodemus, with whom he had three daughters and one son.