The District will not meet the mayor’s goal of slashing the annual number of new HIV infections in half by 2020, health officials said Thursday.

The acknowledgment comes as a new public health report shows the city continues to struggle to end an epidemic affecting nearly 2 percent of the population, one of the highest rates in the country.

Last year, 360 District residents received HIV diagnoses, just 13 fewer than in 2017, according to the report. It is a slight improvement from 2017 when the number of new HIV diagnoses shrank by five.

The city has made significant progress since the mid-2000s, when annual HIV diagnoses topped 1,000.

Nearly 400 people contracted the virus in 2015, Mayor Muriel E. Bowser’s (D) first year in office. She wanted that figure cut in half by 2020 as part of her strategy to stop HIV infections.

The District has been trying to meet this target with a two-pronged strategy. Officials want to treat more people who already have the virus to lower their viral load to a point that they cannot infect sexual partners. And they are trying to increase the use of a daily prophylactic pill, commonly known as PrEP, that reduces the risk of infection by more than 90 percent.

They have made progress on both fronts. Two-thirds of people living with HIV in the District are virally suppressed, and the District reported 3,400 people started taking the daily prophylaxis in 2018.

More than 12,000 residents are known to have the virus. As of 2016, the Washington metropolitan area — which includes Alexandria and Arlington — ranked 16th in HIV infections.

The city is on the brink of reaching another target set out by the mayor: To have 90 percent of District residents with HIV knowing their status and receiving medical treatment.

But District health officials concede it is unlikely that new HIV diagnoses will drop significantly this year.

“We are not maintaining the same levels of decreases that we have seen over the past 10-year period,” said Michael Kharfen, who leads sexually transmitted disease prevention at the D.C. Department of Health.

He said the city faces challenges in reaching the people most at risk for HIV — black gay and bisexual men and black heterosexual women — before they have been exposed to the virus. Those groups are also less likely than white gay men to use a daily prophylaxis, and the city has embarked on a public awareness campaign to change that.

HIV experts said the latest report should galvanize the city to improve its efforts.

The median time between a patient’s diagnosis to the virus becoming undetectable was 114 days. Sarah Henn, chief health officer of the HIV-focused health center Whitman-Walker Health, said reducing that gap is critical to curb the spread of the virus.

“With new medications, a lot of people are undetectable in two-three weeks, and you shorten the time someone can infect someone else from several months to several weeks,” Henn said. “If we are really going to end the HIV epidemic, then we need people started immediately on medication.”

In the past, a positive diagnosis would trigger additional testing before a patient began treatment. Now, Whitman-Walker will have patients begin treatment the same day they test positive.

The latest HIV data suggests the disease is taking hold in a new generation.

Residents under 30 accounted for a third of the new HIV diagnoses last year. The city also reported 13 teenagers diagnosed with the virus in 2018.

The city’s strategy to stop the disease’s spread among young people includes making PrEP available in schools and employing “credible messengers” to encourage peers to use the drug.

“Sometimes people who most need the drugs are least likely to be aware they can have it or be willing to step forward and ask for it,” said Walter Smith of D.C. Appleseed Center for Law and Justice, a nonprofit involved in the city’s HIV prevention strategy. “And if we are talking about really young people, the last thing they want to do sometimes is let their friends and family know they want to take PrEP.”

The city is also trying to expand access to HIV prevention medication. The treatment is already available free at city clinics, but officials want to make it possible for patients to request the medication online and by phone and pick it up from a network of pharmacies across the city.

While PrEP is designed as a preventive measure, similar medication can stop a person from contracting HIV if used consistently for a month after exposure to the virus.

That method is already common among first responders and medical professionals who are exposed to the virus through needles or blood.

“If a person had sex, didn’t use a condom, wasn’t on PrEP, didn’t know the status of the partner, or didn’t know if the partner was on PrEP, so now what? There’s actually something one can do and to think of it as kind of a Plan B for HIV,” Kharfen said.

The District also saw decreases in other sexually transmitted diseases that reached record highs last year, including syphilis, chlamydia and gonorrhea, according to the report.