Mandela, who died Thursday aged 95, faced criticism for saying little about the pandemic while he was president from 1994 to 1999, but became increasingly vocal in later years as the country was ravaged by the disease.
"Africans are very conservative on questions of sex. They don't want you to talk about it," the Nobel Peace Prize winner once said when asked about his initial silence.
"I told them we have got this epidemic which is going to wipe out our nation if we don't take precautions. I could see I was offending my audience. They were looking at each other horrified."
Once he retired from office, Mandela began paying more attention to the scourge of AIDS in a country where some 5.5 million people -- more than 10 percent of the population -- are living with the HIV virus.
In a speech to mark World AIDS Day in December 2000, he said: "HIV/AIDS is worse than a war. As we speak now, there are thousands of people dying from it. But this war can be won. This is one war where you can make a difference."
Two years on, he implicitly criticised his successor, then-president Thabo Mbeki, who had questioned the link between HIV and AIDS.
"The debate about some fundamental issues around HIV continues to rage in manners that detract from what should be our concerns in combatting this major threat to our future," Mandela said in February 2002.
He later told reporters that HIV sufferers should be given anti-retroviral drugs. It was a radical statement at the time, given that the African National Congress (ANC) government was still refusing to make the medicine available at state hospitals, saying it needed to test its toxicity first.
That same year, Mandela met with leading AIDS activist Zackie Achmat to try and convince him to drop his "medicine strike". The HIV-positive campaigner, who was fast contracting full-blown AIDS, had refused to take drugs until the state made it available for free in the public health sector.
The country's Constitutional Court had already ordered the government to give AIDS drugs to HIV-positive pregnant woman.
In the face of growing national and international pressure, Mbeki's cabinet made an about-turn on AIDS in 2003, announcing a plan to make anti-retroviral drugs available at state hospitals.
"Mr Mandela and his (charity) foundation are overjoyed by the government's announcement," the Nelson Mandela Foundation responded.
That same year, Mandela launched his worldwide music 46664 campaign to raise awareness and money in the fight against the AIDS crisis.
The campaign, named after Mandela's number when he was an apartheid prisoner on Robben Island, called for all governments to declare a global AIDS emergency. The campaign included a star-studded concert with Bono of the pop band U2 and American singer Beyonce Knowles.
"No longer is AIDS just a disease, it is human rights issue... We must act now to raise funds to help those affected by AIDS and raise awareness to help to prevent further spread of HIV," Mandela said at the November 2003 concert.
In January 2005, Mandela made his most emotional plea on the disease yet when he revealed that his only surviving son, 54-year-old Makgatho, had died of AIDS.
"For some time, I have been saying 'let us give publicity to HIV/AIDS' and not hide it," a grief-stricken Mandela said.
"That is why we have called you here today. To announce that my son has died of AIDS.
"To come out and to say somebody has died because of HIV... people will stop regarding it as something extraordinary, as an illness reserved to people who are going to go to hell and not heaven," Mandela said.
Mandela is survived by his wife Graca, his three daughters and dozens of grandchildren and great-grandchildren.