A car thief drove off with more than he bargained for Friday morning when he jumped into an unattended car at a gas station at William Street and Fillmore Avenue.

A 3-year-old was in the back seat.

The toddler – unharmed – and the vehicle were later recovered.

Police charged both the suspected car thief and the child’s mother.

Shortly after 12:30 a.m., a man got into the vehicle after the driver went into the gas station. She left the keys and the toddler in the car, police said.

Surveillance video and a tip led officers to the car and child about 90 minutes later in the 100 block of Detroit Street, a few blocks to the west, according to police spokesman Michael J. DeGeorge.

The toddler, still in the car, was not harmed, DeGeorge said.

Carl Thomas, 24, of Buffalo, found in the 400 block of Fillmore Avenue, not far from the scene of the crime, was charged with grand larceny, kidnapping, reckless endangerment and unauthorized use of a vehicle.

The toddler’s mother, Shawntey Harper, 28, of Buffalo, was charged with reckless endangerment.