Mandela addressed a crowd of about 15,000 at the fifth international 46664 concert he has hosted to raise awareness of the disease, held this year to mark World AIDS Day.
Recent U.N. figures estimate that the number of AIDS cases fell from almost 40 million last year to 33.2 million in 2007.
"This lower figure suggests that prevention programs have been successful in bringing down infection rates," Mandela said. "That trend is encouraging but it is still alarming that for every person receiving treatment four others are newly infected."
"If we are to stop the AIDS epidemic from expanding we need to break the cycle of new HIV infections. All of us working together with government, communities and civil society can make the difference that is needed. Together we have the power to change the course of destiny," he said to rapturous applause.
Wearing a sweat shirt emblazoned with 46664 - the number apartheid prison authorities gave him - the 89-year-old statesman beamed and waved at the crowd who chanted his name.
Since stepping down as South Africa's first black president in 1999, Mandela, whose son died from the disease, has championed the cause of AIDS victims.
About 5.5 million of the 48 million South Africans are infected with the AIDS virus - the highest number in the world - and about 900 people in the country die of the disease every day.
Sub-Saharan Africa remains the center of the epidemic. AIDS is still the leading cause of death there; it particularly affects women and children.
At the event, the singer Annie Lennox expressed her anger at the number of children who die from AIDS-related diseases.
"Why is this happening?" Lennox asked. "It is an outrage and it needs to be dealt with. It is unacceptable that children die from a preventable disease. Treatment works. Get your government to do something about it.
The reference was to South Africa's often confusing message about antiretroviral drugs, and the slow rollout of the lifesaving medicines.
Star after star appealed to the crowd to heed the slogan of the campaign - "It is in your hands" - calling on them to get tested and practice safe sex.
The musician Peter Gabriel likened the fight against AIDS to the fight against apartheid.
Introducing his song "Biko," about the South African activist who died in detention in 1977, Gabriel paid tribute to the bravery of those who fought the racist regime.
"We must not forget them. We need to focus the same power and intensity in the struggle against AIDS that was in the struggle against apartheid," he said.
Speaking at a World Aids Day event elsewhere in the country, President Thabo Mbeki, who has been criticized for his handling of the AIDS crisis, stressed that government's call on South Africans to be faithful and use condoms was not being heeded.
"What is really of importance is that we must, all of us, take these messages very seriously, particularly our young people," Mbeki said on SABC radio.
"We don't want our people to be suffering from ill health when they could have handled their own lives in a way that makes for healthy lives."
Mandela launched the AIDS awareness campaign in 2003. Funds raised through the concerts are used to increase awareness of the AIDS pandemic, particularly among young people. More than $3 million has been raised through the concerts so far.
Other performers Saturday included Angelique Kidjo, Ludacris, Corinne Bailey Rae and the Goo Goo Dolls. All performed for free.