His lawyers had argued that the law should be overturned because it allowed for the prosecution of teenage boys for having sex with teenage girls but prevented prosecution of the girls.
The High Court ruled against him and this morning, the Supreme Court upheld the High Court decision.
The case was described as a challenge to the so-called “Romeo and Juliet” legislation.
The boy is charged under the 2006 Criminal Law (Sexual Offences) Act, with having sex with a 14-year-old girl in the Donegal Gaeltacht in 2006. He is also charged with buggery.
His trial has been on hold pending the outcome of this appeal.
Section 3 of the Act created an offence of defilement of a child under 17 and provides for a sentence of up to five years in prison.
Section 5 of the Act states a girl under 17 cannot be guilty of such an offence.
RTE reports that while the law did amount to gender discrimination, that discrimination was not disproportionate because the risk of pregnancy is born by girls only.
Chief Justice Ms Justice Susan Denham said section 5 of the act excluded the girl from criminal liability when the offence was sexual intercourse.
She said the Oireachtas made a choice and such a legislative decision reflected social policy on the issue.
She said it was an approach the legislature was entitled to take. The danger of pregnancy for the teenage girl was an objective which the Oireachtas was entitled to take account of.