"Yours falls into the serious category ... after 20 years in the armed forces you should think this type of behaviour is in no way acceptable."
Judge McDonald said when police spoke to Ahipene he said he could not remember what he had done as he was intoxicated.
The case had deeply affected the girl's family, particularly her mother, and the victim impact report left him saddened.
"Thankfully the baby will have no recollection of what you did," Judge McDonald said.
The judge said he needed to roundly denounce Ahipene's actions and hammer home to anybody considering sexually abusing children that they would be dealt with firmly by the courts.
A starting prison term for Ahipene was 20 months, the judge said. But he gave him credit for his early guilty plea, remorse and previous good character - including 20 years' army service - and reduced it to 15 months' jail.
The judge said defence lawyer Arthur Fairley accepted that home detention was not appropriate and a senior probation officer expressed concerns that if Ahipene - an alcoholic - continued to abuse alcohol he may offend.
"It's a great shame that you have been a servant to your country in the armed forces for so long and you have come to this point," Judge McDonald said.
"You came to this point because of excessive consumption of alcohol, together with what must have been some deviant thoughts."