The Gibraltar Supreme Court is considering whether the age of consent for gay men is discriminatory.
The territory currently allows lesbians and heterosexuals to have sex at 16, but the age of consent for gay men is 18. Anal sex is illegal between men and women.
Chief Minister Peter Caruana and Attorney General Ricky Rhoda have asked the court to declare whether the current law is constitutional.
The Gibraltar government’s arguments against lowering the age of consent for gay men were published in February.
It argues that the matter can be justified on health and religious grounds.
Documents said: “Religious faith plays an important role in our community and is also an important part of its social cohesion which would be undermined.”
On health, they added: “widening the range of sexual practices which can be committed with young people puts even more pressure on them to be sexually active and there is no doubt that anal sex carries greater health risks than heterosexual intercourse.”
The government also argues that it is heterosexuals being discriminated against, rather than gay men, as straight couples are completely banned from having anal sex.
The British government will argue that the law must be changed to comply with human rights legislation. It has the power to impose legislation on Gibraltar and has not ruled out doing so.
According to the Gibraltar Chronicle, a referendum could take place if Chief Justice Anthony Dudley rules that the law is unconstitutional but will not say what the age of consent for everyone should be.
Options could include allowing gay men to have sex at 16, bringing the age for everyone up to 18 or meeting halfway by making it `17.