Baton Rouge police say they arrested a 24-year-old man accused of driving with an open container with an unrestrained two-year-old in the backseat of his car — and had to use a stun gun to stop the man when he tried to flee.

William Womack would not yield to lights and sirens when an officer tried to pull him over for failing to dim his headlights at around 1:30 a.m. Tuesday, according to a police report.

When Womack pulled over in a Toyota Camry at 9700 Avenue I, he took off running — and led an officer on a 150-yard chase before the officer managed to subdue him with a stun gun, the report says.

The officer looking into the vehicle saw an unrestrained two-year-old child lying on the backseat of the car, police said, and a partially-consumed 24-ounce beer can in the car’s center cup holder.

Womack, of 1805 Bay St., Baton Rouge, was booked into Parish Prison on counts of child desertion, resisting an officer and flight from an officer.