An 18-year-old charged with having sex with a 14-year-old girl when he was 15 has begun a legal challenge to the legislation under which he is charged.

He is accused of having sex with the girl in August 2006.

The man says that the 2006 legislation that allows him to be prosecuted but states that a girl under 17 is not guilty of an offence is old fashioned gender-based discrimination for which the State has no justification.

He is charged under Section 3 of the Criminal Law Sexual Offences Act of 2006 and faces a maximum of five years in jail if he is convicted.

Under Section 5 of the same act, a girl under 17 cannot be charged with an offence for engaging in sexual activity.

The boy's lawyers told the court the legislation proceeded on the basis that the boy was ‘the guilty party’ and the girl was a ‘comely maiden’ whose virtue must be protected.

Senior Counsel Gerard Hogan said that if he was convicted he would face a conviction for a sexual offence with all the ignominy and distress associated with that.

He said he faced the prospect of having his life destroyed.

Mr Hogan said five years in prison and a conviction for a sexual offence for a boy of 15 who engaged in consensual sexual activity was a 'savage penalty'.

Mr Hogan said the State's justification for the provision in the legislation was that an underage girl would be deterred from engaging in sexual activity by the prospect of becoming pregnant.

The Oireachtas had to ‘equalise’ the positions of a boy and a girl by providing an equal deterrent to a boy in the form of making the sexual activity a criminal offence, he said.

He added that no sane person would encourage a 14 and a 15-year-old to engage in sexual activity but he said this was nakedly gender based legislation.

He said no one would suggest that pregnancy in a young girl was something that could be countenanced but he said there was no comparison between pregnancy and the prosecution for a sexual offence, which would destroy a young life.

The legislation was enacted in the aftermath of the Supreme Court ruling that found that the laws governing statutory rape were unconstitutional because they did not allow for a defence of reasonable mistake about a girl's age.

Mr Hogan said this was not the kind of case that came up after the Supreme Court ruling where for example a 40-year-old man took advantage of a 12-year-old girl.

He said this was two youngsters engaging in sexual activity and he said this was the reality of the conduct of a significant minority of young people ‘like it or not’.

Professor Sheila Green, Director of the Children's Research Centre at Trinity College Dublin gave evidence that an increasing number of young people were having sex before the age of consent.

It was almost normative behaviour she said and studies had found that in most cases it was consensual.

Thousands of young people were having sex under the age of consent she said. Thousands of boys were therefore liable to prosecution.

She said we may not like the idea of very young teenagers indulging in sexual activity but it is part of the everyday reality she said.

If every case like this one came to light she said, the courts would be full of cases like this because it is such a frequent activity.

The case is likely to continue until Friday.