The number of people infected with the virus that causes AIDS has doubled in the past decade to 40 million, and there is no end in sight as the pandemic continues to outpace efforts to prevent new infections and treat those already sick, according to a new U.N. report released Monday.

The annual report from UNAIDS noted some hopeful signs, including modest decreases in infection rates in Zimbabwe, Kenya and Burkina Faso and the growing availability of lifesaving antiretroviral drugs, even in some of the world's poorest countries. There are some indications that efforts to curb risky behavior such as multiple sexual partners has succeeded in some countries, U.N. officials said.

But the overall picture that emerges from the 98-page report is of a disease that shows little sign of coming under control despite a massive, global effort that includes research into vaccines, public education campaigns and the large-scale distribution of sophisticated antiretroviral drugs.

"It's increasing everywhere," said Jim Yong Kim, director of HIV-AIDS for the World Health Organization, speaking from New York on Monday in a teleconference with journalists. "The report illustrates very clearly that we really are failing in attempting to prevent the epidemic in most of the world."

Of the more than 3 million people who have died of AIDS-related illnesses in 2005, more than 500,000 were children, the report said.

By far, the hardest-hit region is sub-Saharan Africa, home to more than half of those with HIV, the virus that causes AIDS. Three-quarters of those who died of AIDS-related illnesses lived there, as do two-thirds of the nearly 5 million people estimated to have become infected in 2005.

Yet there is plenty of troubling news in other regions, including worrisome spikes in infection rates in both Pakistan and Indonesia, and a record number of new infections in Latin America. In the United States, Canada and Europe, the number of infections was growing as prevention efforts appeared to wane, U.N. officials said.

One surprisingly positive development, officials said, was a decline in the rate of new HIV infections in Zimbabwe, a southern African nation whose economy, medical system and basic freedoms have collapsed as President Robert Mugabe has tightened his 25-year-old grip on power. Mugabe's international isolation has driven away many donors, meaning Zimbabwe gets far less funding to fight AIDS than its neighbors in the region.

Nevertheless, in a region where infection rates are the highest in the world, the rate of infection among pregnant women in Zimbabwe dropped from 26 percent in 2003 to 21 percent in 2004. Part of the decline, U.N. officials said, came from the high death rate among those with AIDS in Zimbabwe because of the extremely limited availability of antiretroviral drugs. Yet changing behaviors, including a decline in the number of sexual partners and an increase in condom use, were cited as major factors as well.

In Zimbabwe, "there has been a massive community response to the epidemic which I think has been invisible to the rest of the world," said Paul De Lay, director of evaluation for UNAIDS, speaking from Rome during the teleconference. "Somehow people are recognizing the risk and doing something about it even in the midst of the current political problems."

Infection rates also dropped in Kenya, from 10 percent of adults in the late 1990s to 7 percent in 2003, and Burkina Faso, where the prevalence of HIV in young pregnant women declined from 4 percent in 2001 to 2 percent in 2003. Such decreases have been rare in the AIDS pandemic.

The report also said antiretroviral drugs are now reaching more than 1 million people in low- and middle-income nations. An estimated 300,000 deaths in these nations are being prevented this year because of these drugs, which interrupt the reproduction of the virus and, when used consistently, drive it down to undetectable levels.

The drugs are almost universally available to those with AIDS in the wealthiest nations and are becoming common in many other countries. Four out of every five patients in need of antiretrovirals in Argentina, Brazil, Cuba and Chile now get them.

Yet in Africa, where medical systems are weak and frequently overwhelmed by high caseloads of AIDS, only one in 10 of those needing antiretrovirals is getting the medicine.

Among the problems is a shortage of money to fight the disease, according to U.N. and other global health officials. Richard Feachem, executive director of the Global Fund to Fight AIDS, Tuberculosis and Malaria, said quadrupling current funding to $20 billion a year would produce dramatic drops in new infections and mortality.

"Investment in AIDS works," he said, speaking by phone from Geneva, "but the world is seriously under-investing."