David Kato had faced renewed threats after winning an injunction against a tabloid that called for him to be hanged

He was known as the "grandfather of the kuchus", as gay people in Uganda call themselves, a brave and fiercely committed activist who led the struggle for gay rights for more than a decade. David Kato went to jail for his beliefs, and to court, winning his greatest victory three weeks ago against a newspaper that had called for him to be hanged.

But early on Wednesday afternoon he appeared to have paid the ultimate price: he had been battered to death with a hammer in his home in Kampala, shocking the gay and human rights communities locally and abroad.

As distraught family and friends gathered at the scene, police said they had arrested a man hired to drive for Kato and were pursuing another male suspect seen leaving the house in the Mukono area of Kampala soon after the attack. A police spokesman said the motive appeared to be robbery.

But given the fierce anti-gay campaigns launched in recent years by some religious leaders and journalists, as well as politicians who drafted laws to have gay people locked up for life or even executed, there are inevitable questions as to whether Kato was killed because of his sexuality.

One of the few openly gay men in Uganda, and the most vocal local critic of the proposed legislation, Kato had told close friends of increased harassment since the court victory on 3 January, and of receiving warnings that people were going to "deal with him". Frank Mugisha, a close friend and colleague at the human rights group Sexual Minorities Uganda, where Kato was the advocacy officer, said: "He mentioned increased threats – a lot more than usual. He was even directly threatened outside the court."

Human Rights Watch and Amnesty International called on the Ugandan government to ensure an in-depth and impartial investigation into the case, and to protect gay activists, many of whom have received death threats in the past. Local campaigners expressed similar sentiments.

"This is a great shock, a tragedy, to lose such a brave activist," said Professor Joe Oloka-Onyango, director of the human rights and peace centre at the faculty of law, Makerere University, who worked with Kato on the recent court case. "It is the first time a gay activist has been killed here and it suggests there could be serious danger for other activists. There is a climate of fear."

Kato began campaigning for gay rights in Uganda in 1998 when virtually nobody was "out". Homosexuality was illegal, and offensive to most Ugandans. In the following years the gay rights movement became stronger, with Kato and his colleagues at Sexual Minorities Uganda calling for gay people to be included in national HIV-awareness and treatment programmes.

But the higher profile created enemies. Local religious leaders, especially some prominent evangelical Christians, launched campaigns alleging that the gay community was seeking to "recruit" schoolchildren. Their efforts were boosted by visits from several American preachers renowned for their homophobic views.

Ugandan politicians then came on board, with the MP David Bahati presenting the anti-homosexuality bill to parliament in 2009. Besides calling for life imprisonment and the death sentence for gay people, the bill requires all Ugandans to report "homosexual activity" within 24 hours or face police action.

The proposed legislation, together with statements from political leaders, including President Yoweri Museveni, who repeated the unproved "recruiting" claims, caused real fear among gay activists. Kato gave a lecture at Cambridge University last year titled A Matter of Life and Death: The Struggle for Ugandan Gay Rights.

That fear was heightened late last year when a tabloid called Rolling Stone started publishing pictures of gay activists and other alleged homosexuals under the headline: Hang Them. Kato, who was in his mid-40s, and two colleagues took the paper to court, winning a permanent injunction preventing it from identifying gay people and damages of £410 each.

Dr Chris Dolan, the director of the refugee law project at Makerere University and part of a coalition that helped bring the case, described Kato as "an incredible activist who took a lot of flak for being one of the few openly gay people in Uganda".

Dolan said the three plaintiffs had discussed the security implications of their court action at length. "We were trying to take measures to improve security but you can't protect people in their homes 24 hours a day," he said. Pepe Julian Onziema, who was part of the court action, said she had spoken to Kato about security hours before his death. "We were due to meet yesterday [Wednesday] to discuss security arrangements, but he said he did not have money to get to town," she said. "A few hours after we spoke, his phone was off," she said.

Police said there had been a spate of killings recently in the area where Kato died. Judith Nabakoba, a police spokeswoman, said the second suspect being sought was a recently released prisoner who had been living with Kato and who had made off with the victim's briefcase. "Right now this man is nowhere to be seen," she said.

But Kato's friends and colleagues believe his sexuality and work are likely to have played a role in his murder. Oloka-Onyango said Kato did not appear to have been involved in "shady business or party politics, the things that normally lead to this kind of attack".

"This is a very strange thing to happen in the middle of the day, and suggests pre-meditation," he said.

A joint statement from several civil society organisations in South Africa, where Kato lived in the 1990s, paid tribute to "our courageous queer African martyr", and said that certain politicians and religious leaders in Uganda were "at least in part responsible for this callous murder" due to their "fostering of prejudice and homophobia".