The antiretroviral drug Truvada. (Photo illustration by Justin Sullivan/Getty Images)

The government reported more evidence of progress against HIV on Tuesday, citing an 18 percent decline in the number of U.S. infections between 2008 and 2014 and even sharper drops among heterosexuals and people who inject drugs.

The Centers for Disease Control and Prevention said that the estimated number of infections fell from 45,700 in 2008 to 37,600 in 2014, after remaining at roughly the same level for more than a decade. Heterosexuals saw a 36 percent decline in HIV diagnoses during the same period, and intravenous-drug users experienced a 56 percent drop despite a burgeoning opioid epidemic.

The number of annual infections among gay and bisexual men and black men who have sex with men — two subgroups that for years have made up a disproportionate share of HIV patients — leveled off. The CDC called this a hopeful sign after years of rising incidence among both groups.

The number of infections declined or remained stable in the 35 states that reported data, as well as in the District of Columbia.

The agency attributed the progress to public education efforts that encourage people to know their HIV status and to treatment with medications that keep viral loads low and reduce transmission. Increased use of these antiretroviral drugs before exposure — known as pre-exposure prophylaxis — also may have helped reduce transmission.

Jonathan Mermin, director of the CDC’s National Center for HIV/AIDS, Viral Hepatitis, STD and TB Prevention, said that while the opioid epidemic “threatens” the success at quelling HIV among intravenous-drug users, a number of factors have contributed to its decline in that population.

“More of them have been diagnosed and effectively treated, which dramatically reduces their risk of transmission and helps them live longer, healthier lives,” Mermin said. “And many communities have established syringe-services programs that allow people who inject drugs to use sterile injection equipment.”

Some populations did not share in the advances. Among gay and bisexual men ages 25 to 34, the number of diagnoses rose by 35 percent in 2014, from  7,200 to 9,700. Among Latino gay and bisexual males of all ages, it increased by 20 percent, from 6,100 to 7,300. Residents of Southern states, which make up 37 percent of the population, accounted for half the estimated number of infections in 2014.

The new data was presented Tuesday at the Conference on Retroviruses and Opportunistic Infections in Seattle and issued via a CDC release. The six years studied mark a period during which the agency has been counting a type of white blood cell to confirm diagnosis and then estimate how long a person has been infected. The data released comes from estimates based on that test and reports from the 36 jurisdictions.

The agency said the numbers mark its first official report on the drop in HIV incidence in the United States.

In 2015, the CDC reported a 19 percent drop in HIV diagnoses between 2005 and 2014, driven mostly by infection declines among heterosexuals and intravenous-drug users.