A high court judge on Thursday handed down the sentence to 22-year-old Sidney Nsubuga Enoch, who admitted that he bludgeoned David Kato to death with a hammer in January.
Kato’s slaying came only months after his picture was published in an anti-gay newspaper next to the words “Hang Them.”
See also: Weekend Getaway Guide: Washington, D.C.
Enoch said he was provoked by sexual advances that Kato made toward him.
Gay rights activists have blamed an increase in homophobia in Uganda on evangelical preachers.
In May, the Ugandan parliament adjourned without discussing a controversial bill that proposed the death penalty for some homosexual acts.