For a decade, the fight to reduce the number of people who get the virus that causes AIDS hit an impasse in New York State.

The pendulum is now swinging.

For the second year in a row the number of new diagnoses of H.I.V. infections in men who have sex with men dropped in New York State for 2016, after a decade where the rate of new infections refused to budge. The number of new infections in the overall population fell as well, by an average of nine percent statewide, more than double the rate of decline in past years, according to data released on Friday by the governor’s office.

The decline follows the adoption of new preventive drugs as well as crisis measures instituted by the governor in 2014, when the state infused additional tens of millions dollars into a new, multipronged approach to combating the disease.

Particular bright spots in the data were the strides made among communities historically overrepresented in H.I.V. contraction rates, such as Latinos and, in particular, blacks, who, while representing less than 15 percent of the population nationally, have accounted for nearly half of all new infections, according to a 2015 report from United States Centers for Disease Control.

In New York, there was an 11 percent drop in new diagnoses among Hispanics in 2016, and a seven percent drop in new cases among blacks. The most significant drop was among young people age 20 to 24, where the number of new infections fell 20 percent.

In 2016, 2,881 people were newly diagnosed with the virus in New York, compared to 3,163 the year before. Men who have sex with other men accounted for 1,804 new infections in 2015. In 2016 the number fell to 1,580. Among Hispanic men who have sex with other men, new diagnoses fell 18 percent, but for blacks in the same category the progress was but incremental: The numbers of new infections were just 3 percent less than the year before.

The fall in new infections is the first fruit of the state’s 2014 education and anti-H.I.V. innovation effort, known as Ending the Epidemic, according to Governor Andrew M. Cuomo, who vowed that year to reduce the number of new contractions in the state to about 750 people by 2020.

“New York was once the epicenter of the disease,” the governor said in a statement. “And we will continue to do everything in our power to save lives, reduce transmissions and forge a path toward eliminating H.I.V./AIDS for the rest of the world to follow.”

The state has done things like increase the number of needle exchanges and send out teams to educate doctors on the use of a drug approved in 2012 that staves off infection, known as PrEP. It has also tried innovative approaches, like placing geo-targeted ads on homosexual dating apps like Grindr and Adam4Adam offering users at-home H.I.V. tests.

“We are heading in the right direction,” said Johanne Morne, the director of the New York State Department of Health’s AIDS Institute. “New York State has shown historic signs that would lead us to believe that we can significantly reduce the rate of infections by 2020 — we have shown that we can.”

Joy Washington, 26, of the Bronx, walked out of the Morrisania Sexual Health Clinic on Thursday afternoon after undergoing a round of tests for STDs including H.I.V. She said she wished more people would follow her example.

“It’s just reassurance for myself at the end of the day, and to also show my partner as well that everything was fine,” she said as she left. “And I would like the same back in return.”

A version of this article appears in print on , on Page A18 of the New York edition with the headline: After Years at Standstill, Rate of H.I.V. Infections Declines Across the State. Order Reprints | Today’s Paper | Subscribe