Background. The epidemiologic trends of hepatitis B virus (HBV) infection in human immunodeficiency virus (HlV)-infected patients over the past 20 years are largely unknown. Methods. Prevalence and risk factors for HBV infection overall, at the time of HIV infection, and after HIV infection were examined in an ongoing observational HIV cohort study. Risk factors for HBV infection at the time of diagnosis of HIV infection were evaluated using logistic regression, and risk of incident HBV infection after diagnosis of HIV infection was evaluated using Cox proportional hazards models. Results. Of the 2769 evaluable participants, 1078 (39%) had HBV infection, of whom 117 (11%) had chronic HBV infection. The yearly cross-sectional prevalence of HBV infection decreased from a peak of 49% in 1995 to 36% in 2008 (P<.001). The prevalence of HBV infection at the time of diagnosis of HIV infection decreased during 1989-2008 from 34% to 9% (P<.001). The incidence of HBV infection after diagnosis of HIV infection decreased from 4.0 cases per 100 person-years during the pre-highly active antiretroviral therapy (HAART) era to 1.1 cases per 100 person-years during the HAART era (P<.001); however, this incidence remained unchanged during 2000-2008 (P =.49), with >20% of HBV infections occurring after HIV infection being chronic. Decreased risk of HBV infection after diagnosis of HIV infection was associated with higher CD4 cell count and the use of HBV-active HAART. Receipt of ≥ 1 dose of HBV vaccine was not associated with reduced risk of HBV infection after diagnosis of HIV infection. Conclusions. Although the burden of HBV infection overall is slowly decreasing among HIV-infected individuals, the persistent rate of HBV infection after diagnosis of HIV infection raises concern that more-effective prevention strategies may be needed to significantly reduce the prevalence of HBV infection in this patient population.