A 15-year-old boy has lost his High Court action in Ireland that he should not be prosecuted for having sex with a 14-year-old girl. He now faces trial and could got to jail for up to five years if convicted.

The current law, which was upheld, allows boys to be prosecuted for having sex, but not girls.

"As the risk of pregnancy as a result of underage sex was borne by girls only, not boys, society was entitled to deter such activity and to place the burden of criminal sanction on those who bear the least adverse consequences” said Justice Elizabeth Dunne.

In his action, the boy stated his rights were excluded because he has been charged with unlawful carnal knowledge and with committing buggery while the girl faced no charge.

As the girl cannot be found guilty of underage sex, he argued that he was being discriminated against on grounds of gender.

The "adverse consequences that flow from under age sex fell to a greater extent on girls rather than on boys," she said, adding that the "law provides a limited immunity to girls in the one area of sexual activity that can result in pregnancy.

“Society is entitled to deter such activity and to place the burden of criminal sanction on those who bear the least adverse consequences of such activity,” she said.

The boy will now go to trial.

A stay on the boy’s trial pending the outcome of the High Court challenge will remain in place until next month to allow his lawyers consider the judgment.