Diagnosis of primary human cytomegalovirus (HCMV) infection is accomplished exclusively by serologic testing. Among the possible methods, the determination of immunoglobulin G (IgG) avidity is one of the least explored. In this work, we used a commercially available kit to test anti-HCMV IgG avidity in 336 serum samples from pregnant women and transplant recipients undergoing virologically proven HCMV primary or nonprimary infections and from latently infected blood donors. Our results demonstrate that the anti-HCMV IgG avidity test differentiates primary from nonprimary HCMV infections in both pregnant women and solid organ transplant recipients. In fact, 88.6% of primary infections and no secondary infections showed low-avidity IgG to HCMV. In particular, low IgG avidity is a marker of primary infection for 18 to 20 weeks after onset of symptoms in both immunocompromised and immunocompetent subjects.