A court in the US has ruled that a gay Mexican with Aids is eligible for asylum because of the danger of persecution in his home country.
Mexico City has long celebrated gay pride but the US court was sceptical
The appeals court in San Francisco overturned earlier rulings by immigration courts.
The three-judge panel said Jose Boer-Sedano, 45, would probably face further abuse in Mexico and have difficulty getting Aids treatment.
"It really does mean that he'll be safe now," said Mr Boer-Sedano's lawyer.
Angela Bean said her client was overcome with emotion at the court's decision.
Mr Boer-Sedano testified that in his home country he had been forced to perform sex acts by a police officer who threatened to kill him or expose his homosexuality.
He said he had been shunned by his family.
"Despite his attempts to conceal his sexuality, others could perceive it and Boer-Sedano was ostracised by his family, friends, and co-workers on that basis," the judges wrote in their judgement.
"His family refused to allow him to interact with other family members or his friends, fearing that Boer-Sedano would be a 'bad influence' on them."
The court said that the death threats by the police officer - Mr Boer-Sedano said he was stopped nine times in three months in the late 1980s - constituted persecution by a government agent.
Mr Boer-Sedano, who now works as a waiter in San Francisco, arrived in the city on a six-month visa in 1990, and remained for seven years before moves were made to return him to Mexico.
San Francisco's Ninth US Circuit Court of Appeals has made several rulings granting asylum to gay or transsexual applicants from Latin America where it has found they have been abused by police.
The US state department has reported that in Mexico violence against homosexuals is widespread.