A judge in Uganda has ruled in favour of a petition to stop media companies from outing homosexuals.
The judge ruled that publishing the identities of gay people violates their country's constitutional right to privacy.
The decision was described as a "landmark ruling" by gay rights activists.
The case was brought against The Rolling Stone newspaper which last year published several lists of people its editor said were gay.
Many said they were attacked after their names and photos were printed.
Homosexual acts are illegal in Uganda and activists say the gay community still lives in fear.
The newspaper argued that as the three people who brought the case were known gay rights leaders, it could not be punished for saying they were homosexuals.
But lawyer John Francis Onyango said Judge Vincent Musoke-Kibuuke ruled that their lives had been threatened as they risked being attacked by vigilantes.
One of the articles published had the headline "Hang them" above a list of names and photos.
The three were also awarded 1.5 million Ugandan shillings ($US650) in compensation and the newspaper was ordered to pay all associated legal costs.