Two men who were sentenced to two years in a Fiji jail for consensual gay sex have been freed after a Fijian High Court Appeal.

The two men, Thomas McCosker (55), an Australian and Dhirendra Nadan (23), a Fijian were arrested after making a video of them having sex in their hotel room.

The High Court ruled that consensual gay sex is legal when in private, however the country’s constitution states that public displays of homosexuality are illegal. Crimes related to homosexuality can lead to prison sentences of up to 14 years, although the laws relating to gay sex are rarely enforced.

High Court Judge Gerald Winter said “the constitution requires is that the law acknowledges difference, affirms dignity and allows equal respect to every citizen as they are.”

However, state prosecutors have stated that they may appeal the decision to the country’s Supreme Court.