He said he felt his job demanded that he advocate for the tens of millions of H.I.V.-infected people, including those in South Africa, even though many say a United Nations official has no right to criticize a member state.

Mr. Lewis has long been critical of countries for failing to help women who become infected.

“Gender inequality is driving the pandemic, and we will never subdue the gruesome force of AIDS until the rights of women become paramount in the struggle,” he said.

The inequality of women makes them highly vulnerable to becoming infected through “marital rape to rape as a war crime,” Mr. Lewis said, adding that, while sexual violence occurs everywhere, in Africa, “The violence and the virus go together.”

Preventing the transmission of the AIDS virus from infected pregnant women to newborns, which can be done with simple regimens, is “very near the top in the hierarchy of preventive measures,” he said. But the vast majority of pregnant women in the world, he said, go without such prevention, and even the women who receive it are not given full treatment to help keep them alive, so their children often become orphans.

Yet the world is doing very little for orphans whose number is expected to grow to 18 million by 2010. “I appeal to everyone to recognize that we are walking on the knife’s edge of an unsolvable human catastrophe,” Mr. Lewis said.