PROLONGED ATTACK: Denham Jones, 16, who was sentenced to four years' jail for sexual assault.

A 16-year-old has been jailed for four years for a violent sexual assault after his parents recognised him in a photo released by police.

Denham Jones assaulted his 17-year-old victim in a prolonged attack in a public toilet after following her along Napier's Maadi Rd in the early hours of November 25 last year.

He crossed a road and patted her bottom as he walked past. She became concerned and ran into nearby public toilets.

Jones banged on the door trying to make her open it. She refused. After it went quiet she unlocked the door. But Jones was waiting and pushed his way in. He told her he wanted to have sex with her.

When she refused he took a spanner from his pocket and threatened her. He forced her to perform and participate in multiple sexual acts. She was found in a distressed state by a member of the public.

Police issued a media release seeking information and an image of a man using a nearby ATM machine.

Jones' parents recognised the man as their son and took him to the Napier police station.

Jones said he was in the area to have a fight with someone he met on Facebook and denied attacking the girl.

He only confessed after DNA results showed he was the assailant. He pleaded guilty to two charges of unlawful sexual connection and was sentenced in the Napier District Court on Thursday.

Judge Geoff Rea expressed concern that a probation officer had led Jones to believe that he may be sentenced to home detention.

The charges were "extremely serious" and home detention "was never a possibility as far as the law is concerned and it is disappointing if you and your family were given false hope".

Judge Rea said Jones had not accepted responsibility "in the conventional sense" as he had claimed he had blacked out at the time of the attack and could not remember what had occurred.

He said the victim was a strong woman, but the impact of the attack would "remain with her for the rest of her days".

A psychiatrist reported that Jones was difficult to assess.

On one hand he was a "very introverted, quiet and polite young man who was described by others as kind, helpful, passive and caring", yet other sources found him a "disregulated, impulsive and aggressive young man" with limited or no empathy.

The judge said courts had recognised that young people had lapses of judgment, but he labelled Jones' offending as being "deliberate, violent and disgusting".

He took into account reports outlining difficulties faced by Jones, his youth, and his guilty plea, then sentenced him to four years and one month imprisonment.