Police found an infant alone in a car after the car crashed early Thursday morning in Janesville.

The baby girl was covered with glass from the crash but was checked out at a hospital and found to be unharmed, said Janesville police Lt. Todd Kleisner.

The driver, who was the baby’s father, had flagged down another car and got a ride to a gas station, where he realized he had left his daughter and got a ride back to the car, Kleisner said. The people who gave him the ride to the gas station did not know about the baby, according to the release.

Tony O. Long, 25, of Stoughton arrived at the scene as police were investigating the crash. They arrested him on charges of intoxicated driving with a child passenger, child abandonment, hit-and-run to property, driving without insurance, and driving while suspended.

Court Commissioner Stephen Meyer ordered Long held on a $500 cash bond each for two charges he faces and called for no contact with the victim.

David Olson, a representative from the Rock County District Attorney’s Office, said Long had appeared in Colombia County Court about 15 hours before the crash and pleaded guilty to a count of delivering cocaine.

Court records show Long was sentenced to serve three years of probation with a 60-day jail sentence with work release, which was to begin Sept. 24.

Police and fire units had responded to a one-vehicle crash at 1:45 a.m. Thursday near the roundabouts at Racine Street and Interstate 90/39, according to a police news release.

Kleisner did not know what the vehicle hit, but he suspected it was the roundabout curb and plantings.

Paramedics found the 3-month-old in the car. Police stayed with the baby at the hospital until the mother was identified and reunited, according to the release.

Kleisner did not know how long the girl had been alone in the car, but based on the circumstances he guessed about 10 minutes.

Update: This article was updated at 5:05 p.m. Friday with details from a court hearing.