Army regulations are unlawfully requiring soldiers who join up before their 18th birthday to serve a longer minimum period than those who enlist as adults, it has been claimed in the High Court.
A judge heard accusations that the difference in treatment was causing real distress to young soldiers who wished to leave but were prohibited from doing so.
The accusations were made by Child Soldiers International (CSI), a charity that seeks to prevent the use of children in armed conflicts around the world and to protect the welfare of young soldiers.
The charity is asking Mr Justice Kenneth Parker, sitting in London, to declare that provisions of the Army Terms of Service Regulations 2007 are resulting in "less favourable treatment" for under-18s and are unlawful under the European Equal Treatment Directive.
David Wolfe QC, representing CSI, said the minimum service period applied to adult Army recruits was four years.
The minimum period for under-18s was also four years - but added on was the length of time they had served before their 18th birthday.
Those who enlisted at 16 could serve up to two years longer than adult recruits, Mr Wolfe said.
The rules meant an under-18 recruit was bound for an extended period by the Queen's Regulations and the Armed Forces Act, which imposed numerous legal restrictions on freedom of association, political activity and the right to communicate freely in public.
It was because of the difficulties for individual soldiers raising the point that Child Soldiers had felt compelled to intervene, Mr Wolfe submitted.
Lawyers for Defence Secretary Michael Fallon are opposing the charity's application for judicial review, which is being heard over two days.
They say it is not accepted that under-18s are treated less favourably.
They also say there is no "six-year trap" for young soldiers, as suggested by the charity's witnesses.
Ben Collins, appearing for the Defence Secretary, argued the UK had exercised its right to opt out of the equal treatment directive in so far as it related to discrimination on the grounds of age.
But if the court concluded that the directive did apply, the Army policy on under 18s was justified, he argued.
It was the Army case that they were not deployed in operations that might expose them to hostile action, and those who were deployed in error were quickly withdrawn.
The regular Army, which has a current strength of around 82,000 officers and soldiers, was currently experiencing difficulty with recruitment.
There was a shortfall of 22% in 2014-15, even taking into account the reduction in regular troop numbers over the course of the last few years, said Mr Collins.
Reducing the period to be served after reaching the age of 18 would have inevitable consequences for manning levels.
The hearing continues tomorrow.