The High Court has ruled that the tear-gassing of four teenagers in Darwin's Don Dale Youth Detention Centre was unlawful.

It comes after an appeal was launched against lower-court findings that adult prison officers were authorised to use the gas during a night of unrest in August 2014.

The four detainees were aged between 15 and 17 at the time of the incident. They were locked in their cells while tear gas was sprayed to subdue another detainee who had escaped his cell after prolonged isolation in the dilapidated Behavioural Management Unit.

The High Court has now reached a majority ruling, finding that exemptions allowing the guards' use of the gas did not apply in the youth detention centre.

The tear gas was sprayed by prison guards from the nearby adult jail, who were called in to respond to the disturbance.

High Court Chief Justice Susan Kiefel and Justice Patrick Keane ruled this was not allowed under the laws of the Northern Territory.

“It is no part of a prison officer's function to use a weapon in a youth detention centre,” they wrote.

It potentially opens the door for teenagers to claim damages for battery.

The group has previously been awarded limited damages for aspects of their treatment, including the use of spit-hoods and leg shackles.

Northern Territory Supreme Court Judge Judith Kelly previously ruled that the tear-gassing was reasonable and necessary, but the High Court has now sent the matter back to the Northern Territory Supreme Court for another judge to assess damages.

The Northern Territory has been ordered cover the legal costs of the detainees, who were represented by high-profile barrister Bret Walker SC.

Footage of the tear-gassing sparked a royal commission into the Northern Territory's youth justice system, which in 2017 called for the use of tear gas in youth prisons to be banned.