A court in Cairo has sentenced eight men to three years in prison for appearing in a video allegedly taken during a gay wedding on a boat.

The video shows two men kissing and exchanging rings on a Nile boat as their friends cheer, the metro.co.uk reported. The video became a YouTube sensation after being posted online in September.

For their alleged appearance in the clip, eight men were arrested and sentenced to three years in prison. Egypt's top prosecutor has branded the clip as 'shameful to God'. A spokesman for the justice ministry's forensics department, however, said the men were innocent.

"The entire case is made up and lacks basis. The police did not arrest them red-handed and the video does not prove anything,' the report quoted an official as saying.

"The medical test showed that the eight defendants have not practised homosexuality recently or in the past," he added.

Although homosexuality is not illegal in Egypt, it is still taboo and gay men have allegedly been arrested in the past on the grounds of "immorality".

Human Rights Watch said that Egyptian authorities had tortured men suspected of having gay sex and condemned the 'medical tests' authorities used - anal examinations.