A British man who had been jailed in Morocco because of homosexual images found on his smartphone has been freed and returned to Britain.

Ray Cole spent four months in jail in Morocco, where homosexuality is a criminal offense.

The 69-year-old was arrested with a younger Moroccan man. Friends and family launched a social media campaign asking authorities to free him.

Cole, who suffers from medical problems, said he was relieved to be home after landing Tuesday night in London. He received a conditional release from Moroccan officials.

Adrian Cole thanked the "thousands of people" who supported his father and also thanked Moroccan authorities for listening to their appeal.

It was not known whether the Moroccan man arrested with Cole has also been released.