The man has interim name suppression but Judge Raoul Neave advised it will lapse at a later date. The reasons for the suppression, which also prevents other details from being released, cannot be published.
The court heard how the man was the victim's classroom teacher at the time.
If he required tasks done, he often asked the girl to carry them out.
Judge Neave noted the girl was "something of a favourite" for the man.
On one occasion between August 31 and September 30, 2012, the girl entered a room the teacher was in.
The man told the girl that he wanted a cuddle and then hugged her.
The court heard that he placed a hand on her bottom and kissed her on the face and mouth, "some of them hard".
The girl was scared and when she tried to get away noticed that the man's penis had become exposed.
She told her mother what happened and the teacher apologised.
Defence counsel Marcus Zintl said the man had stopped teaching girls the day he offended.
He now works on a farm, the court heard.
Zintl described the offending as being "somewhat opportunistic" with an element of spontaneity.
Crown prosecutor Mitchell McClenaghan highlighted the breach of trust involved, with the offender being the girl's teacher at the time.
Victim impact statements showed the offending had a "very significant impact" on all concerned, Judge Neave said.
It had a clear psychological impact on the girl, who had suffered from guilt, he said.
He hoped that with appropriate treatment "and a sensible approach" the effects on the victim would not be long-lasting.
A pre-sentence report was largely favourable, he said, with the man taking full responsibility for his actions.
The offending involved a significant abuse of trust, Judge Neave said, but concluded there was no clear evidence of premeditation.
The man claimed he had no intention of exposing his genitals but rather it was "an accident involving clothing".
The man was given credit, and a reduction in sentence, for an early guilty plea, previous "impeccable character", no history of offending, being assessed a low risk of reoffending, and the offending being deemed at the lower end of the scale of the charge.
He has not been placed on the Child Sex Offender Register.