Xander Gerber was discharged without conviction on two charges of doing an indecent act with intent to insult when he appeared in the Hamilton District Court.

﻿A man who exposed himself and masturbated in front of two young girls has been granted a discharge without conviction.

Xander Gerber, 21, appeared in the Hamilton District Court this week after earlier pleading guilty to two charges of committing an indecent act with intent to insult or offend.

Gerber's victims were aged seven and nine at the time, and the offending took place in two separate incidents in Waikato in March 2017 and July 2018.

Further details about the victims and the circumstances of the crimes cannot be reported without leading to their identification.

​Gerber applied for and was granted the discharge by Judge Denise Clark, however he did not entirely escape w​ithout penalty. He will have to pay his victims reparation of $2500 each.

In court, his counsel James Gurnick argued the consequences of a conviction would greatly outweigh the gravity of the crimes. This was because a conviction created "a real and appreciable risk" for Gerber to be deported to his home country, South Africa.

Gerber had come to New Zealand with his family when he was about 10 years old and had no connection with that country. He had also fathered a daughter here.

"The only life he has known is here in New Zealand."

Gerber had no previous convictions, he had expressed "demonstrable" remorse, and there had also been no actual physical contact between him and the two girls, Gurnick said.

The incidents were of a "lower to moderate scale".

"It was impulsive behaviour. There was no pre-determined decision to expose himself to a young child. It was more opportunistic."

Gerber also suffered from issues including post-traumatic stress disorder and a major depressive disorder. However "there is no definitive reason why he has acted in this way," Gurnick said.

The mother of one of Gerber's victims was in court, and she gave a statement attesting to how his deeds had affected her daughter.

The girl had quickly changed from being a happy and sweet-natured child to being withdrawn, sullen, and prone to angry outbursts and hysterical crying.

She was also now very wary around men.

Police prosecutor Karl Little said there was insufficient evidence to suggest the consequences would be too great and, regardless of whether a conviction was entered, Immigration New Zealand was aware of Gerber's conduct.

He was potentially facing deportation irrespective of whether he was convicted or not.

There was a degree of pre-meditation and "a level of predation" to what was serious sexual offending - too serious to not be marked with a conviction, Little said.

"Society has an expectation. Justice must not only be done, it must be seen to be done."

Judge Clark, however, was unconvinced.

"It's clear to me you are truly remorseful," she said. "I'm satisfied that if convicted there would be a real and appreciable risk of deportation ... Your support is here."

Gerber's reparation will have to be paid in full to each victim by January 3.