A 38-year-old man has been granted asylum in the United States after a court accepted he would be persecuted if he returned to Mexico.

Jorge Soto Vega entered the USA illegally in 1988, and had previously had an asylum application turned down by a judge who said he would have had to make his sexuality obvious to face persecution.

U.S. 9th Circuit Court of Appeals overturned that ruling, and at an immigration hearing on Tuesday Mr Vega was finally told he can remain in America.

“It’s been a long, long wait to get to this point where I feel today, secure and happy,” Mr Vega told The Los Angeles Times.

The court was heard that while living in Guadalajara Mr Vega was beaten by police, robbed and subjected to death threats and homophobic abuse.

Mr Vega paid someone to smuggle him to the United States, where he lived in the Los Angeles area.

After a brief visit to Mexico in 2001, when he told the court he was afraid for his life, he filed an ayslum application upon his return.

Jon W. Davidson, legal director at Lambda Legal, a nonprofit gay-rights group, represented the asylum seeker. He said of the case:

“Overwhelming testimony shows severe persecution of gays in all areas of Mexico and therefore the inability of [Vega] to move safely to any other area.”

“He’s a 38-year-old man who is not married and has never been married. In Mexico, that means you’re gay,” Davidson said, according to The Los Angeles Times.

The same judge that turned down Mr Vega’s first application ruled on Tuesday that attempting to pretend to be heterosexual was not an adequate protection from persecution.

The U.S. Immigration and Customs Enforcement agency said the will not appeal the case.

In the past three months Mexico City and the province of Coahuila passed laws legalising civil unions for gay and lesbian couples.