A 42-year-old man who indecently assaulted a 9-year-old girl told police "something happened to him" when he saw her getting changed.

The man, who has interim name suppression until Monday, appeared before Judge Michael Turner last week for sentence in the Invercargill District Court after he admitted indecently assaulting a girl on April 2.

Judge Turner said the man agreed to take photographs of the 9-year-old girl and his sister. He took them to the beach to take photographs and while there indecently assaulted her.

The man told the girl not to tell her mother but she did.

When spoken to by police, the man co-operated and admitted the offending. He said something had happened to him when he saw her getting changed and he was seeking help for it.

The man was taking steps to address the issues he faced.

The girl had since had trouble sleeping and her mother felt she had not kept her daughter safe, the judge said.

Defence lawyer Kate McHugh said the offending was at the lowest level of its type.

The man was assessed at a low risk of reoffending and a low risk to the community.

Judge Turner sentenced the man to five months' home detention and ordered him to pay $500 emotional harm reparation.

An application for final name suppression was dismissed but the man was granted interim name suppression until 4pm on Monday.