A Long Island mom was allegedly caught buying heroin — while her 4-year-old son waited in the car, police said.

Michael Scalia and Nicholas Verna

Giovanna Mirando, 34, parked her 2004 Toyota Corolla on a street in Holbrook on Friday around 2:30 p.m. when her passenger, Nicholas Verna, 32, hopped out and bought the drug from Michael Scalia, also 32, a few steps away, Suffolk County Police said.

Verna returned to the car, kept some of the drugs and handed Mirando the rest, cops said.

As Mirando started to drive away, detectives and officers stationed nearby pulled her over — and found the little boy in the back seat, according to police.

Mirando, of Middle Island, was charged with criminal possession of a controlled substance and endangering the welfare of a child. She was released on bail and will be arraigned at a later date.

Verna and Scalia were charged with criminal sale of a controlled substance and criminal possession of a controlled substance, cops said. Both were arraigned Saturday.