New HIV/AIDS data released by the D.C. government Wednesday show fewer new cases and fewer deaths in 2012 than years prior, but infection levels remain at epidemic rates in the District, officials said.

According to data compiled by the District’s health department, 680 new HIV cases were reported, down from 722 new cases in 2011 and 1,180 in 2008. And 221 HIV-positive city residents died in 2012, down from 345 in 2008 and 229 in 2011, with fewer of those 2012 deaths due to causes related to the infection.

More than 16,000 city residents lived with HIV in 2012, representing a steady rise that city officials attribute to more thorough testing, better treatment and rising survival rates.

“Treatment is working,” said Mayor Vincent C. Gray (D). “People are living much longer than they used to live.”

The new numbers represent ongoing and unmistakable progress in a city where, five years ago, a health official shocked many by declaring that D.C.’s HIV infection rate was “on par with Uganda and some parts of Kenya.” A city government that has in the past fumbled its response to the virus and squandered vast resources now seems to have found its footing.

New HIV/AIDS data released by the D.C. government on Wednesday shows fewer cases in 2012 than in previous years, but levels still remain at epidemic rates.

Still, the newly reported rate of infection — roughly 2.5 percent of the population — exceeds the World Health Organization definition of a “severe epidemic.” And the virus continues to affect disproportionate levels of African Americans, with an infection rate of 5.7 percent among black men in the city.

Standing in front of a banner that read “Join the Rubber Revolution,” Gray said the city needed to continue focusing on prevention efforts, which include HIV testing, needle exchange for users of intravenous drugs and condom-distribution programs.

An ongoing independent assessment of the city’s efforts to combat HIV/AIDS, conducted by the D.C. Appleseed Center for Law and Justice, hailed many of those efforts last year but also criticized the D.C. government’s management for a “perceived lack of vision and communication.”

Raymond Martins, chief medical officer for Whitman-Walker Health, a clinic that has historically cared for large numbers of the city’s HIV/AIDS patients, said the report represented “outstanding news” overall.

“This confirms what we‘ve been seeing,” he said. “People are getting diagnosed before they’re getting sick, they are getting medications and have decreased viral load.”

Lower “viral load” — the amount of HIV that circulates in an infected person’s bloodstream — is associated with a lower risk of transmission, creating a virtuous cycle in which those who are HIV-positive become less likely to infect others, Martins said.

In another encouraging development, fewer HIV cases are progressing to AIDS. In 2012, 370 new AIDS cases were diagnosed, down from 424 in 2011 and 564 in 2008.

Sex between men remains the most common mode of HIV transmission, according to the new data, with heterosexual contact not far behind. But cases of transmission through intravenous drug use have sharply declined in the past five years, from 39 cases in 2008 to 13 cases in 2012 — a development several officials attributed to the expansion of needle-exchange programs, for which government funding was blocked by Congress until 2009.

Black men who have sex with other men represent one in four of the 16,000 residents living with HIV, the report found. The next largest demographic group identified in the epidemiological study were black heterosexual women, representing 16 percent of all city HIV cases.

Martins said the rate of heterosexual infection remains high when compared to other large cities. “People think they’re in monogamous relationships when actually their partners are having sex with other people,” he said. “People are honest with us but not necessarily honest with their partner.”

D.C. Council member David A. Catania (I-At Large), who pushed to improve the city’s response to HIV and AIDS as Health Committee chairman from 2005 until 2013, said he was particularly pleased that, for the second year in a row, no babies were born in the District with HIV in 2012.

Less than a decade ago, he said, one in 10 of the HIV-positive babies born in America were born in the District.

“It goes to show when we take an evidence-based approach to these diseases, we can produce better outcomes,” he said. “We are nowhere near where we need to be for me to be satisfied. But we are many, many, many miles down the road toward improvement.”

The careful review process for epidemiological data means the new figures are already 18 months old, but the city’s health director, Joxel Garcia, said he expects continued progress in 2013 and 2014. While data from last year will not be finalized for public release until next year, he said, informal survey numbers are used to target city resources to HIV “clusters” in the District.