After a decade of holding steady, the number of Americans infected with HIV has begun to increase. But the news is better than it sounds.

Experts say the total is growing because fewer people are dying of AIDS. Doctors' spectacular success in treating the disease over the past six years is paying off in an unexpected way.

The Centers for Disease Control and Prevention estimates that in their most recent calculations for 1999 and 2000, the number of people infected by HIV increased by about 50,000. This means between 850,000 and 950,000 Americans were infected with HIV, the most ever.

``The assumption is the increased survival of people with AIDS is driving this, and that's good news. It shows the benefits of therapy,'' said the CDC's Dr. Patricia Fleming, who presented the latest estimates Monday in Seattle at the Ninth Annual Retrovirus Conference.

The government estimates that 40,000 Americans catch HIV each year, a figure that has remained roughly stable for over a decade. However, until the turnaround in AIDS therapy, this figure was nearly offset each year by AIDS deaths, so the total number of Americans carrying the virus stayed level.

Now, AIDS deaths have plunged from around 40,000 annually to about 15,000. As a result, new infections are outstripping deaths.

During the 1980s, the government believed that as many as 1.5 million Americans had HIV, but it later revised that figure downward. According to the latest estimates, between 400,000 and 450,000 were infected in 1984. This grew to 550,000 to 650,000 in 1986. By 1992, the figure was 650,000 to 900,000.

Survival increased almost overnight when drug combinations that included medicines called protease inhibitors became standard in 1996. They transformed HIV from a death sentence to a chronic treatable illness.

By the late '90s, many doctors feared these gains would evaporate as the treatments lost their punch. Doctors noticed that after initial success that seemed to eliminate HIV, many patients developed viruses that were resistant to all the major classes of medicines. Their virus levels crept back to the point where they that could be measured on standard tests.

Doctors worried that the virus would eventually resume its destruction of their immune defenses.

To their relief, however, this has not often happened. Even when resistant virus emerges, patients who stay on the drugs usually keep their HIV levels low and remain free of obvious disease. Dr. Constance Benson of the University of Colorado said that in her AIDS practice, the annual death rate is 1 percent to 2 percent and is not changing.

``The fear that treatment failure would result in a subsequent rise in mortality has not so far panned out,'' she said.

A major CDC goal is to increase testing among people at high risk of catching HIV. Infected people should know about it so they can begin treatment when necessary and guard against spreading HIV to others.

Fleming said that about three-quarters of infected people in the United States know they have the virus, up from about two-thirds in 1998. ``The proportion is improving, but we have a long way to go,'' she said.

No one knows precisely how many of the estimated 670,000 Americans with HIV are being seen by doctors for their infections. However, the data suggest that about one-third have not received basic blood cell counts, which are the standard first step in HIV care.