It is proved that the 3-part of the class number of a quadratic field ℚ(√D) is O(|D|55/112+ε) in general and O(|D| 5/12+ε) if |D| has a divisor of size |D|5/6. These bounds follow as results of nontrivial estimates for the number of solutions to the congruence xa,≡, yb modulo q in the ranges x ≤ X and y ≤ Y, where a,b are nonzero integers and q is a square-free positive integer. Furthermore, it is shown that the number of elliptic curves over ℚ with conductor N is O(N55/112+ε)in general and O(N5/12+ε) if N has a divisor of size N5/6. These results are the first improvements to the trivial bound O(|D| 1/2+ε) and the resulting bound O(N1/2+ε) for the 3-part and the number of elliptic curves, respectively. © 2005 London Mathematical Society.