An emerging bird flu pandemic with the potential to kill millions of people around the world could be nipped in the bud if it were discovered within a week or so of its initial eruption and battled intelligently with drugs and quarantines, according to the first computer models to show how the disease would spread and what it would take to stop it.

The computations offer a modicum of hope amid a din of alarming predictions about the catastrophic outbreak now thought to be brewing in South Asia.

"The models show that if you combine well-directed, targeted treatment with some social interventions like closing schools, ideally together with some vaccination, it's conceivable you'd be able to stop the epidemic," said Anthony S. Fauci, chief of infectious diseases at the National Institutes of Health, which funded much of the work through its National Institute of General Medical Sciences.

But the odds of success are tempered by many "ifs," Fauci and others warned.

The plan would work only if authorities recognized very quickly that the flu virus had morphed into the contagious form that can trigger a pandemic.

It would work only if health officials around the world immediately shipped to the outbreak area as many as 30 million tablets of the one medication scientists expect could be helpful.

It would work only if local agencies managed to distribute those drugs to the vast majority of people who may have had recent contact with the victims -- schoolmates and workmates at a minimum but, better yet, anyone who may have gone to the same restaurants, ridden the same buses, or shopped or prayed in the same venues.

And it would work only if most residents over a potentially sprawling region obeyed orders to stay home as the emergency blossomed.

"If we get to the point where there are thousands of cases, we just have no chance of containing it," said Neil M. Ferguson of Imperial College in London, lead author of one of the studies, which appears in today's issue of the journal Nature.

"Basically, you contain it at the source or you fail," agreed Ira M. Longini Jr., a biostatistician at Emory University's Rollins School of Public Health in Atlanta, who led the other study, published in today's online edition of the journal Science.

At issue is the H5N1 strain of avian flu virus that is spreading among birds and other animals in Asia. Of more than 100 people reported to have been infected in the past 18 months, about half have died. But the virus has the potential to cause global devastation if, as many scientists expect, it gains the ability to spread easily from person to person.

No vaccine exists against the virus, though experimental versions are being raced into development. The one drug that seems able to prevent infection and reduce the virus's spread is oseltamivir (sold as Tamiflu). More than two dozen countries and the World Health Organization (WHO) are stockpiling the drug. But supplies are so limited that it would be impossible to treat everyone in the event of an outbreak.

That is where the new models come in. By mapping as precisely as possible how a newly contagious strain would spread from a single inaugural patient in rural Asia, scientists can see how best to deploy their few medications and initiate other strategies.

Both models used rural Thailand as their starting point -- not because it is the most likely place for an outbreak to begin but because sociologists have collected detailed information on "social networks" in that region. Such studies show age ranges and household sizes in rural Thai society and describe the frequency and nature of social interactions, including trips to shops, schools and temples, to estimate how many others these people are likely to come into contact with.

With that information as a foundation, and with added assumptions about viral behavior based on previous pandemics, the two studies came to similar conclusions.

Ferguson's program found, for example, that in the absence of emergency control measures, much of the country would be peppered with cases within a month after the first patient got sick, making containment virtually impossible.

By contrast, there would be about a 90 percent chance of stanching the epidemic if the outbreak were recognized at a point when only about 20 people had grown ill -- and if 10-day courses of Tamiflu were then quickly distributed to all the patients' classmates, workmates and household members.

Both models showed better odds of success if drugs were supplied more broadly to everyone living within a few miles of each case, if quarantines were imposed, and if even partially effective experimental vaccines were used.

All told, it might take 100,000 to 3 million 10-day courses of Tamiflu to achieve control, the models predict.

WHO has about 120,000 courses stockpiled and says it can get them anywhere in the world within a week. The United States has about 2.3 million courses but, like most countries, has not announced a clear policy on sharing.

Michael T. Osterholm, director of the Center for Infectious Disease Research and Policy at the University of Minnesota, expressed doubts that nations would be able to respond as quickly and efficiently as the models require.

Few countries in South Asia have the capacity to detect and verify cases quickly, he noted, adding that many send blood tests out of the country for processing.