A police officer in St. Peter, Minn., spotted a house on fire late at night while on patrol and rescued a couple, their baby and the family’s dogs from the smoke and flames before firefighters arrived.

“The residents said they had no idea their home was on fire” until the arrival of officer Joshua Klaseus about 2:45 a.m. Tuesday, said Police Chief Matt Peters.

“Officer Klaseus’ observations and quick action undoubtedly saved three lives as well as the lives of the family’s two dogs,” the chief said.

Peters identified the family as Christopher Jansma, 29, and Desarae Block, whose 30th birthday was on the day of the fire, and their 9-month-old son Jack.

Klaseus was patrolling near Hwy. 169 and Dodd Road, where he saw smoke and spotted the home in the 1800 block of N. 3rd Street partly engulfed in flames, police said.

He notified dispatch and then opened a side door of the house, choked back smoke and yelled “police ... anyone in here?” as he entered.

The second-year officer saw a woman in the home, who said to the officer, “ ‘What’s going on? What’s going on?’ ” Peters said.

“ ‘Your house is on fire; get out,’ ” the chief said his officer responded.

She asked where Jack was and said her son was still inside. Klaseus thwarted her attempt to go back in the burning house, and he reentered and soon encountered a man cradling a baby.

Klaseus led the man and the child outside to the waiting woman and the family’s two dogs.

“We tell cops to stay out of fires,” Peters said, “but this was a situation where he had no choice.”

The house did have a smoke detector, but it failed to work properly, the chief said. The cause of the fire remains undetermined at this early stage, he said.