The effect of lamivudine on chronic coinfection with hepatitis B virus (HBV) in human immunodeficiency virus (HIV)--infected patients was studied prospectively. Nineteen patients with HIV infection, who were receiving an anti-HIV regimen containing lamivudine (150 mg twice daily), and who had replicative chronic HBV infection, were followed for a median of 14 months. Twelve patients' regimens contained protease inhibitors. Serum HBV DNA became undetectable, by means of molecular hybridization, in 14. Seroconversion of hepatitis B e antigen to antibody occurred in 6 of 17 patients, and seroconversion of hepatitis B surface antigen to antibody occurred in 1 of 19. The median serum alanine aminotransferase concentration had decreased by the time of the final evaluation. The median CD4 cell count increased and plasma HIV RNA was undetectable in 10 of 19 patients. Five patients had recurrence of detectable serum HBV DNA despite good compliance with treatment, and 2 mutations related to the resistance of HBV were detected. These patients had a significantly longer duration of treatment (21 versus 13 months; P<.05). In conclusion, resistant strains of HBV emerge at high detectable levels while patients receive anti-HIV regimens containing lamivudine.