OTTAWA -- A former residential-school student is entitled to compensation for abuse at the hands of a nun, the Supreme Court of Canada says in a decision that helps clarify the scope of appeals in such cases.

The decision came Friday in the case of an Indigenous man, known only as J.W. due to privacy considerations, who said he was assaulted at a residential school in Manitoba.

For over a century, tens of thousands of Indigenous children were required to attend residential schools, primarily run by religious institutions and funded by the federal government.

Students were not allowed to use their languages or cultural practices.

Former pupils provided accounts of physical, sexual and emotional abuse as part of an independent assessment process to determine how they would be compensated for what they went through, a program that flowed from a major 2006 settlement agreement aimed at ensuring a lasting resolution of the residential schools legacy.

J.W.'s claim was rejected by an adjudicator on the grounds that he had failed to show the nun's alleged act -- grabbing his penis while he was lightly clothed, waiting in line for a shower -- had a sexual purpose.

His efforts to have the decision overturned by other adjudicators failed, but a Manitoba judge found fault with the internal decisions and sent the case back to the initial adjudication phase. A reconsideration adjudicator decided in J.W.'s favour in September 2016, awarding him $12,720.

Meanwhile, however, the federal government successfully challenged the judge's ruling in the Manitoba Court of Appeal, which said that, under the terms of the assessment process, judges can't carry out detailed reviews of adjudication decisions.

In its decision Friday, the Supreme Court said the courts can intervene if there is a failure to apply the terms of the settlement agreement.

However, in looking at the specific facts of J.W.'s case, only five of seven judges agreed that his appeal should succeed and that he could be compensated. Of the five, the judges split along two lines of reasoning.

In writing for three members of the court, Justice Rosalie Abella said while claimants in the assessment process do not have a "broad right" to judicial intervention, "they do have a right to the implementation of the terms of the settlement they bargained for."

"The courts' supervisory power must permit intervention when it is necessary to ensure the benefits promised are delivered."

Abella lauded the 2006 settlement agreement as a respectful part of the healing process following a profoundly shameful era in Canada's history.

The legacy of abuse committed at residential schools consists of "deep wounds not only to those who were forced to attend, but also to our national psyche," she wrote. "The recovery process, when it is possible, is slow and painful."