The incident happened on Friday in Hammonton.
Police say a woman placed her 2-year-old grandson and her dog in the back seat of a car, closed the doors, then went to open the driver's side door.
However, that's when she noticed her keys were still on the passenger's seat, and all of the doors were locked.
Police say she dialed 911, and soon Troopers Jacob Sherry and Steven Hodge arrived.
Due to the heat, and that the troopers could see perspiration on the child, Hodge broke the window and Sherry got the child and dog out of the car.
Both were okay.
Police say this "The appreciative grandmother taught us all a very valuable lesson. Secure your keys before placing children and animals in cars."
Send a breaking news alert
Report a correction or typo
Learn more about the 6abc apps