The government, which has come under criticism for its often confusing approach to fighting AIDS, had resisted creating a widespread program to provide the drug nevirapine to HIV-infected pregnant women. The drug has been shown to severely reduce women's chances of passing the virus to their babies during labor.
CBS News Correspondent Mark Phillips reports South Africa's AIDS problem is fundamental: President Thabo Mbeki's government still refuses to concede that the HIV virus causes AIDS.
Only the relentless campaign led by Zakie Achmat, an AIDS sufferer himself, has pushed the government into offering even the limited treatment it now grudgingly provides.
"We see in the government's position not just inaction, floundering and so on but we see a denial of the fact that we actually have a disease of which we are dying," he said.
At a clinic in the Khayelitsha township outside Cape Town, pregnant women arrive every day to be given bad news. Their blood is drawn and analyzed with an instant HIV testing kit. Two dots appearing in the test sample spell doom. A positive test.
"I saw nine patients," said Nurse Nosiphiwo Ntshanga. Three got positive results.
A quarter to a third of the women who visit the clinic find out they're carrying the HIV/AIDS virus. In other areas of the country the rate is even higher -- reaching 50 percent.
For Phumeza Mkiva and thousands of others Thursday's court decision is salvation in a handbag -- she's trying to save her baby.
But the battle against AIDS is a highly political one in South Africa. It took demonstrations and a court challenge to get treatment for pregnant women, and the millions of other sufferers still have no access to government care.
The French charity Doctors Without Borders gives treatment and medication to those it can.
But the sad fact is that even if the South African government did pour more money into treating those with HIV/AIDS, the epidemic is so widespread in these townships it would probably be a losing battle anyway. What many are trying to do is give the next generation a fighting chance.
And for now, that means treating the pregnant mothers so their babies might be born AIDS-free and so they themselves might survive to bring those children up.