The first confirmed case of lesbian transmission of H.I.V. was reported on Thursday by federal health officials, who said the event was exceedingly rare but nonetheless advised lesbian couples in which one partner is infected to take precautions.

Genetic tests showed that the virus in both women was more than 98 percent identical, all but proving that one had infected the other, according to the Morbidity and Mortality Weekly Report issued by the Centers for Disease Control and Prevention.

In numerous previous studies of women who thought they might have been infected by other women, either no genetic testing was done or the newly infected women reported other activity that could have been the cause, such as recent sex with men, drug injection or transfusions.

The women in the new case, both in their 40s, lived in Houston when the transmission took place in 2012. The infected partner had been on treatment for H.I.V. from early 2009 to late 2010 but had stopped taking the drugs. The women reported having sex during their periods and using insertive sex toys, sometimes so roughly that bleeding occurred.