The man was dehydrated and close to passing out after finally being rescued by Mossos d' Esquadra, Catalonia's regional police force.
“Luckily it was a cloudy day, for if there'd been direct sun, he'd be dead,” explained Joan Carles Valero, the owner of the car who wrote about the experience in ABC newspaper.
Valero explained that he had received a call from the regional police force asking him to return to his car because a man was trapped inside and appeared to suffering from heat exhaustion.
He believes that the man, who is thought to be an Iraqi, had opened the rear passenger door of the Audi A3 while he stepped away to buy a pay-and-display ticket from the machine.
The owner then returned with the ticket, placed it in the windscreen and locked the car, not realising that the thief could gain entrance to the vehicle.
But what the unlucky thief didn't bank on was that the central locking system could not be disabled from the inside and he was forced to wait in the car until someone spotted him and called the police.
“He was waiting for nearly four hours!” remarked Valero.