An off-duty Philadelphia police officer rescued a 1-year-old child who had been locked inside a car Sunday afternoon outside a Bensalem Target store.

Just before 4 p.m., when the temperature outside hit 97 degrees, the officer pried open a car door to rescue the baby. A passerby had reported seeing the girl and alerted police. But when Bucks County authorities arrived at the scene, the officer, who's name has not been released, was already holding the baby, CBS Philly reported.

Officials told NBC10 the 1-year-old girl had been alone in the car for 14 minutes, and the car's internal temperature had reached 115.4 degrees at the time of rescue.​

The girl was transported to St. Mary's Medical Center with her mother. Officials said she appeared to be in good condition.

The baby's grandmother, Patricia Diaz, and aunt, Katia Hernandez, were arrested and taken into custody. They were babysitting for the girl's mother when they decided to go shopping, according to 6ABC.

They told officials they forgot the girl was in the backseat when they exited the vehicle to go into the store, NBC10 reported.

Both women have been charged with endangering the welfare of a child, and are being held in Bucks County Jail after failing to post bail. Their arraignment is scheduled for Aug. 24.