An important reason the disease never took extensive hold in India is that most women here have fewer sexual partners than in many other developing countries. Just as important was an intensive effort underwritten by the World Bank and the Bill and Melinda Gates Foundation to target high-risk groups like prostitutes, gay men and intravenous drug users.

But the Gates Foundation is now largely ending its oversight and support for AIDS prevention in India, just as efforts directed at prostitutes are becoming much more difficult. Experts say it is too early to identify how much H.I.V. infections might rise.

“Nowadays, the mobility of sex workers is huge, and contacting them is very difficult,” said Ashok Alexander, the former director in India of the Gates Foundation. “It’s a totally different challenge, and the strategies will also have to change.”

An example of the strategies that had been working can be found in Delhi’s red-light district on Garstin Bastion Road near the old Delhi railway station, where brothels have thrived since the 16th century. A walk through dark alleys, past blind beggars and up narrow, steep and deeply worn stone staircases brings customers into brightly lighted rooms teeming with scores of women brushing each other’s hair, trying on new dresses, eating snacks, performing the latest Bollywood dances, tending small children and disappearing into tiny bedrooms with nervous men who come out moments later buttoning their trousers.

A 2009 government survey found 2,000 prostitutes at Garstin Bastion (also known as G. B.) Road who served about 8,000 men a day. The government estimated that if it could deliver as many as 320,000 free condoms each month and train dozens of prostitutes to counsel safe-sex practices to their peers, AIDS infections could be significantly reduced. Instead of broadcasting safe-sex messages across the country — an expensive and inefficient strategy commonly employed in much of the world — it encircled Garstin Bastion with a firebreak of posters with messages like “Don’t take a risk, use a condom” and “When a condom is in, risk is out.”