On April 23, 1819, incumbent Federalist senator Alexander Contee Hanson died. The other incumbent senator, Robert Henry Goldsborough, ran for re-election to hold his seat.
The Maryland legislature elected a successor to finish Hanson's term, as well as a senator for the term for the other class. The two top vote-getters (both Democratic-Republicans) were declared the winners, with the first-place winner, Edward Lloyd taking the Class 3 seat, which ran March 4, 1819, to March 3, 1825. The second-place winner, William Pinkney, took the Class 1 seat, finishing Hanson's term which ran March 4, 1817, to March 3, 1823.