An officer with the Cheektowaga (NY) Police Department is being praised for rescuing a three-year-old girl from a hot car after the mother apparently overdosed on heroin.

According to US News and World Report, the officer smashed a window in the sweltering car, pulling the girl—who was suffering from dehydration—to safety.

The 28-year-old mother was charged with child endangerment and heroin possession.