An IT worker for the British government who was arrested for giving another driver the middle finger in Dubai has been released from jail.

Jamil Mukadam was detained and thrown in prison in September after he was caught using the hand gesture, which is viewed as a public obscenity in the United Arab Emirates, during a traffic jam in February.

He was arrested at the airport when he returned from the UK to Dubai last month.

The 23-year-old Brit told reporters that he was forced to sleep on the floor of a cell at the Bur Dubai police station for three days and faced up to six months in prison for the offence.

After spending more than three weeks in jail, Mukadam was released and allowed to fly home to the UK on 12 October.

"I arrive at Heathrow tomorrow morning and my family is in tears. I can't wait to see them," he told campaign group Detained in Dubai.

"I have spent over £15,000 in legal fees alone and it will take time for us to recover from this injustice. I am stunned at how little support I received from the British government and how many other people are in this situation," he added.

Mukadam mentioned that while in Dubai he met Scotsman Jamie Harron, who has also been detained by Dubai authorities since July for public indecency and "making a rude gesture".

Harron was sentenced to 30 days in prison and faces an additional much longer sentence was caught with his hand resting on another man's hip. He claims that he placed it there to avoid spilling his drink in the crowded bar.

"I cannot believe he has been stuck here for five months already," Mukadam said. "I really feel for him. He is such a nice guy and also desperate to go home."

Radha Stirling, founder of Detained in Dubai and managing partner at legal advisory Stirling Haigh, called on the government of the UAE to "urgently revise its judicial system to end the wrongful detainment of foreign nationals".

"The country right now, seems to really care about marketing itself as an international tourist destination and investment hot spot but has no legal protection for visitors and expats," she said. "Until serious change is underway, foreign nationals will be apprehensive about visiting the country and many have cancelled their flights in light of the recent highly publicised cases."