Pair production of W bosons constitutes an important background to Higgs boson and new physics searches at the Large Hadron Collider LHC. We have calculated the loop-induced gluon-fusion process gg -> W*W* -> leptons, including intermediate light and heavy quarks and allowing for arbitrary invariant masses of the W bosons. While formally of next-to-next-to-leading order, the gg -> W*W* -> leptons process is enhanced by the large gluon flux at the LHC and by experimental Higgs search cuts, and increases the next-to-leading order WW background estimate for Higgs searches by about 30%. We have extended our previous calculation to include the contribution from the intermediate top-bottom massive quark loop and the Higgs signal process. We provide updated results for cross sections and differential distributions and study the interference between the different gluon scattering contributions. We describe important analytical and numerical aspects of our calculation and present the public GG2WW event generator.