The Connecticut man who buried his girlfriend’s newborn baby in his backyard was only trying to help the panicked teenager after giving birth to a stillborn, the young man’s father insisted yesterday.

“He’s the knight in shining armor in this mess,” said Tom Onellia, whose 20-year-old son Michael allegedly buried the baby in a shallow grave behind the family’s Stamford home last weekend.

Onellia told The Post his son did the deed after his 17-year-old girlfriend called him for help on Dec. 13, crying hysterically because she didn’t know what to do after giving birth to a baby that she said was dead.

“He was just doing what he thought was the right thing to do,” the elder Onellia said. “Burying it was his instinct.”

Police have not charged Onellia or his girlfriend with any crime, pending autopsy results to determine if the baby had been born dead as the girl insisted. They also want to determine if Onellia is the father.

Onellia’s father said yesterday his son had not sired the child, and had only been dating the girl for two months before the tragic birth, which was discovered by authorities on Monday after the girl went to a hospital to be treated for complications.

“He’s in love with [her],” said Tom Onellia. “She’s a sweet girl. She didn’t even know she was pregnant.”

Cops disputed that, saying she concealed the pregnancy. The girl’s classmates at Stamford HS agreed, pointing out that the senior’s condition was obvious to anyone who saw her, though she denied it when questioned.

“She wasn’t in with the smart crowd,” said one Stamford high schooler, who asked that her name not be used. “You could just tell she was wild by the way she would act.”

Yesterday, Onellia’s relatives gathered at the family’s home, although the young man himself has been keeping his distance from friends and family.

While the clan commiserated, the shallow hole where the nameless infant was discovered remained open in the home’s backyard as a ghoulish reminder of what happened.