  We prove that the $2^\infty$-class groups of the imaginary quadratic fields
have the distribution predicted by the Cohen-Lenstra heuristic. Given an
elliptic curve E/Q with full rational 2-torsion and no rational cyclic subgroup
of order four, we analogously prove that the $2^\infty$-Selmer groups of the
quadratic twists of E have distribution as predicted by Delaunay's heuristic.
In particular, among the twists E^d with |d| < N, the number of curves with
rank at least two is $o(N)$.
