Archbishop Desmond Tutu has called for homosexuality to be decriminalised to help tackle HIV.
His comments come in an analysis in The Lancet journal of why incidence of the virus continues to grow among men who have sex with men.
Dr Tutu said anti-homosexuality laws would in the future be seen as "wrong" as apartheid laws are now.
Campaigners said it was important for community leaders to speak out.
The archbishop is patron of the Desmond Tutu HIV Foundation, based in Cape Town, which provides treatment for HIV and carries out research.
Writing in The Lancet, he said: "In the future, the laws that criminalise so many forms of human love and commitment will look the way apartheid laws do to us now - so obviously wrong.
"Never let anyone make you feel inferior for being who you are. When you live the life you were meant to live, in freedom and dignity".