In a couple of papers in 1838 and 1839 Peter Gustav Lejeune Dirichlet proved the first class number formula, for quadratic forms (later refined by his student Leopold Kronecker).
Richard Dedekind's study of Lejeune Dirichlet's work was what led him to his later study of algebraic number fields and ideals.