A three-year-old boy had to be rescued from a hot car while his father visited a sex worker nearby.

Police in the city of Hagen, Germany, in the state of North Rhine-Westphalia, responded to reports of a child alone in a locked car on Monday evening, Heute reported.

The car was fully exposed to the sun and the windows only open about a centimeter, according to the outlet.

The boy was in a car seat in the back of the car, sweating profusely.

The temperature in Hagen that day reached 26C, according to the German Weather Service.

Police were able to get the dehydrated child to open the door, as passersby rushed over to get him water before he was taken to hospital.

The boy’s mother was notified and she told police her son was out with her fiancé.

He returned to the car at about 9:40 p.m., alleging that he had parked and left the sleeping boy in the car while he visited a friend to borrow money.

RECOMMENDED VIDEO

However, upon further probing, investigators determined that the man parked the car at 8:15 p.m. to meet up with a sex worker.

The man has been charged for breach of duty of care and upbringing as well as negligent bodily harm.

Child services were also informed.

The investigation is ongoing.