Treatment Action Campaign activists protest at the 21st International AIDS conference. Many experts have issued stark warnings that recent gains in the fight against the disease are under threat. (Rajesh Jantilal/Agence France-Presse via Getty Images)

DURBAN, South Africa — The 21st International AIDS Conference convened here last week amid an emerging global consensus that the end to an epidemic that has killed 35 million people might be achievable. Just weeks before the conference, a high-level meeting of United Nations members in New York issued a declaration renewing commitments to end AIDS by 2030.

That optimism faded as delegates arrived in Durban to news that donor countries had reduced global HIV funding by more than $1 billion from 2014 to 2015. The reduction could jeopardize the remarkable gains made from investments over nearly two decades, including tens of billions of dollars from the United States.

That money has funded advances in and the distribution of lifesaving antiretroviral therapy. More than 17 million people are on treatment. The number of people newly infected with HIV each year has stalled at about 2 million, but it is down from 3.1 million in 2000.

Washington again provided the majority of last year’s HIV-related donations — nearly two-thirds of the $7.5 billion spent. But U.S. funding dropped $500 million from 2014, according to a joint report from the Kaiser Family Foundation and UNAIDS. They attributed it primarily to a timing issue, with the United States set to roll out new programs this year.

Funding from Britain, the second-largest donor, fell by $135 million and from France, the third-largest, by $39 million. Overall, 13 of the 14 donor governments analyzed in the report reduced spending on HIV.

“Brexit” and the ongoing refugee crisis could significantly delay Western European governments from restoring the funding that traditionally accounts for the majority of the remaining global response.

Nearly 20 million people are in need of antiretroviral therapy, many in communities that are difficult and costly to reach. That includes gay men, sex workers and injection-drug users, especially in countries where their behaviors are criminalized. If funding restrictions continue, experts worry that those groups could be left out of the response.

HIV could spread rapidly within the historically large generation of young people in the developing world who are just starting to become sexually active.

“Challenging funding environments don’t get us out of the reality of the situation that if we do not make the progress that is necessary over the next few years to ensure that [HIV prevention and treatment] targets are really being achieved, we will have a severe problem,” said Brian Honermann, deputy director of policy at the AIDS research foundation AmFar.

There are massive gaps between the treatment that experts say could stop the epidemic and the funding necessary to provide that treatment. The World Health Organization released guidelines late last year calling for all HIV patients to be started on drugs at the time of diagnosis. The research group Palladium presented a 97-country analysis at the International AIDS Conference showing that nearly half of the $44 billion cost of anti-retroviral therapy at the clinic level could be unfunded between 2016 and 2020.

Ben Plumley, who heads Pangaea Global AIDS, which links people around the world to HIV services, said the looming challenges underscore how premature it is to be talking about the end of AIDS.

“There’s nothing worse than hearing governments congratulate themselves on a job well done, when the job has only barely started,” he said.

International donors are looking to middle-income countries to take more responsibility for funding their own HIV responses. Domestic spending made up $10.9 billion — or 57 percent — of total HIV resources in 2015, a significant jump from a decade ago. And experts continue to search for ways to save money through more efficient services.

But ending the epidemic will probably require more resources from traditional donor governments, Plumley said.

“I think the question for our leaders is whether they have the guts to say to electorates that, despite all the investments that have been made, we’re still only halfway there,” he said.

The call for increased funding comes as European governments warn that much of the money earmarked for development efforts, including the HIV response, is now being spent domestically on the refugee crisis. Even maintaining current spending levels could be difficult. Instead, they are looking to the United States to hold fast.

“The United States is doing more or less what it’s supposed to do,” said Lambert Grijns, the Dutch ambassador for sexual and reproductive health and rights and HIV/AIDS. His country has historically been among the five-largest contributors to the HIV response but saw a $44 million drop last year. “As long as the U.S. can maintain that position in terms of absolute figures,” he said, “we don’t need to be that worried.”

Activists at the meeting expressed frustration with Washington, which since 2014 has not increased funding for the President’s Emergency Plan for AIDS Relief (PEPFAR), the program that directs the bulk of the United States' HIV spending in the developing world.

The 2016 election has thrown the future of the program into doubt. While Hillary Clinton, the presumed Democratic nominee, has championed PEPFAR, the program had its funding cut during her tenure as secretary of state by more than $300 million between fiscal 2011 and 2012, according to the Kaiser Family Foundation. The Republican nominee, Donald Trump, has been vague about  his plans for international HIV funding.

All of which adds up to a precarious international financial position, activists said.

“AIDS isn’t in recession, and we know wealthy governments have the budget space to increase their investments,” said Asia Russell, executive director of the AIDS advocacy group Health GAP.

AIDS experts are closely watching this year’s drive to replenish the Global Fund to Fight AIDS, Tuberculosis and Malaria — the other major international player alongside PEPFAR — as an important test of donor interest, especially within the United Kingdom. Governments and private donors invest in the Global Fund in three-year cycles.

Mark Dybul, the fund’s executive director, said ahead of the Brexit vote last month that he was “hyper-confident” of reaching the $13 billion fundraising goal. There is uncertainty, though, about how much new British Prime Minister Theresa May’s government will be interested in contributing to the fund or whether other sources will emerge.

“I’m still confident we’ll get to 13,” Dybul said, “but we’ll have to do a lot more work to get there.”

Despite flat funding for PEPFAR, the United States has signaled that it will not allow gains made on its earlier investments to be reversed. Last month, PEPFAR created a $100 million fund to expand services to specific communities that officials are most worried will be left behind in the global response, such as gay men and sex workers.

AmFAR’s Honermann cautioned against an overreliance on any one source, though. “If we don’t continue the global funding, as well as pushing for domestic governments to reach their own funding, it does undermine everything that we’ve accomplished.”

Andrew Green reported from Durban on a fellowship with the International Reporting Project.