A court in Uganda has ordered the immediate deportation of Bernard Randall, a 65-year-old British gay man.

Randall was arrested on charges of “trafficking obscene publications,” which stem from the publication of images of Randall having sex with another man. He risked being jailed for up to two years.

Randall has said that the photos landed in the hands of the tabloid newspaper that published them after his laptop was stolen.

John Francis Onyango, Randall's lawyer, told the AFP that the decision would not be appealed.

The retired former computer analyst from Faversham and his Ugandan partner, 30-year-old Albert Cheptoyek, were dragged from their home at 6:30 in the morning and kept in cells with 18 other criminals for 3 days before they were charged.

Cheptoyek could be jailed for up to seven years if convinced of the more serious charge of “gross indecency.”

“I think they have deported him because he is gay,” Cheptoyek said.

Randall, who came out after his wife of 40 years died, said he was looking forward to seeing his two daughters. He dismissed the charges against him as “lies.”

Uganda is notorious for its harsh anti-gay laws. In 2009, an Ugandan lawmaker introduced a bill that proposed the death penalty for people who repeatedly engage in gay sex. The Anti-Homosexuality Bill has attracted worldwide condemnation and protests. A version of the bill approved last month replaces capital punishment with life imprisonment and awaits the signature of President Yoweri Museveni, who has expressed reservations about the measure.