They are one of the world's most beleaguered gay communities, brutalised by violence, hounded by a law that makes homosexual acts a crime and driven into the shadows in a country where four in five people admit they are homophobic. But now gay people in Jamaica are cautiously optimistic that change may be in the air.

A new government has begun making noises about an end to discrimination and repealing an anti-gay law. Portia Simpson Miller, standing for election as prime minister in December, declared that "no one should be discriminated against because of their sexual orientation", and indicated she would be willing to have gay people in her cabinet. "I certainly do not pry or do not have any intention to pry into the private business of anyone," she said. She won by a landslide.

Maurice Tomlinson, a Jamaican law lecturer and legal adviser to the advocacy group Aids-Free World, says he is delighted by the change of mood – although it has yet to lift the sense of insecurity felt by Jamaica's gay community. Tomlinson, a prominent voice for gay rights on the island, has fled his home because of death threats that followed his marriage to his male partner in Canada after a picture was published in the Toronto Star.

"I was advised to go into hiding," said Tomlinson, in London to collect an award named after murdered Ugandan gay rights activist David Kato for his advocacy work. "I went into a safe house for about three days because my passport was with the UK high commission waiting for a visa to come here.

"Right now I'm not sure if I will be able to go back to teaching this semester."

Tomlinson says Jamaican police have told him that attitudes on the island are unfortunate but "will not change until the law changes".

Even so, he does not yet want the conscience vote on the sodomy law that the prime minister suggested during the election. "Over 80% of Jamaicans have identified as homophobic," he says. "We want more time to explain to the Jamaican people how harmful the law is."

He wants them to know that the law contributes to the spread of HIV, which has a 32% infection rate among gay men compared with 1.6% in Jamaica's general population. Fear of being attacked and murdered drives lesbian, gay, bisexual, transgender and intersex (LGBTI) people to hide their sexuality. The prevalence of HIV puts them at risk but they do not get help to stay safe. Some gay men marry in a bid to seem straight to the outside world and that puts their wives and children at risk of HIV, says Tomlinson.

Backed by Aids-Free World, Tomlinson has lodged a case with the only human rights court recognised by Jamaica – the inter-American commission for human rights. Lead counsel is Lord Anthony Gifford, the British hereditary peer and human rights lawyer who took part in the Guildford Four and Birmingham Six appeals and now has a law practice in Jamaica.

Gifford led the team in the Dudgeon case at Strasbourg in 1983, where they succeeded in getting a judgment that changed the law against homosexuality in Northern Ireland. The law in England had been abolished in 1967, but the British government had argued that Northern Ireland was self-governing and should decide for itself.

Now Gifford is attempting to help overturn a 19th-century British-made law that criminalises homosexuality in Jamaica, just as he did in Northern Ireland. "It's like deja vu," he said.

"The very existence of the law creates a climate of tolerance of prejudice, which leads to real physical harm and fear.

"We hope we will get a ruling in our favour and that will add to the pressure which is in fact mounting in different ways. There is a definite change in the nature of the debate over the last few years, partly because of the courage of people like Maurice."

Papers lodged with the court, which has yet to schedule the hearing, cite violent attacks as recently as last year, some of them involving the police. In February 2011, officers raided two gay clubs and beat and pistol-whipped the patrons, the case alleges. In August, Ricardo Morgan, a hairstylist living in Kingston, was killed in a machete attack because of his sexual orientation.

Tomlinson began his own gay rights campaign by writing to the papers. It was initially a triumph to get something published. Now he gets support. Two weeks ago, the Jamaica Gleaner ran an editorial, entitled "PM should decry homophobic bigotry", calling for protection for Tomlinson from death threats and condemning "the medieval attitude that still largely prevails in Jamaica towards gays". He and others have made TV adverts, some of which have been shown - although one featuring a Miss Jamaica World speaking of her pride in her gay brother was rejected by the station, which said it had to respect the views of the church.

He blames the Eevangelical movement in the US for promoting homophobia. "My mother said when she grew up, Jamaica was a very tolerant society. Noël Coward had a home in Jamaica. Nobody cared. But during the 80s and 90s, rightwing evangelical Christians came. They started to change the attitude of Jamaicans from tolerance towards hate. The preachers in Jamaica picked up on it and started parroting that stuff."

• This article was amended on 14 February 2012. In the original version, David Kato's name was misspelt. This has been corrected.