A British man charged in Uganda after images of him having sex with a man were published in a newspaper is to be deported back to Britain within hours.

The AFP news agency reported Judge Hellen Ajio ruled Bernard Randall, 65, should be deported from Uganda within 12 hours.

All charges against him have been dropped.

He was charged alongside his friend Albert Cheptoyek, 30, a Ugandan national with whom he shares a house.

Mr Randall, from Kent, was arrested in October and charged with “trafficking obscene publications” after Uganda’s Red Pepper newspaper made public the details of the video on its front page under the headline: “Exposed – Top City Tycoons Sodomy Sex Video Leaks.”

Mr Randall, who has pleaded not guilty, claims the film was unearthed by robbers who stole his laptop and passed the footage to the newspaper.

He would have faced a possible two-year prison sentence if found guilty.

In December, Uganda’s Parliament passed legislation to toughen the punishment for same-sex sexual activity, including life imprisonment for ‘repeat offenders’.

The UK and US governments, criticised the move along with business magnate and investor Sir Richard Branson – who has urged for a corporate boycott of Uganda.

Uganda’s President Yoweri Museveni announced he would not be signing the bill last week.