An Ottawa man who forgot to lock his car says he feels like he’s been robbed, even though his vehicle and its contents were never touched by thieves.

Police in Gatineau, Que. handed David Carriere a $52 ticket last Wednesday citing a bylaw requiring drivers to lock up after they park. The province’s Highway Safety Code states, “No person may leave unattended a road vehicle that is in his custody without previously removing the ignition key and locking the doors.”

Carriere said the officer who issued the fine was peering through vehicle windows in the parking lot when he left his car and walked to a nearby restaurant.

“I thought I was seeing someone robbing cars or something like that,” he told CTV Montreal on Tuesday. “As he got closer, it became apparent that he was wearing some kind of uniform. So then I took him to be a security guard. Maybe he was patrolling the parking lot to make sure the patrons of the parking lot are using the services of the shops.”

Carriere said he was inside the steakhouse by the time he realized his vehicle was unlocked. He said he was greeted by the officer when he returned to the parking lot to lock up.

“He said, ‘I have to give you a ticket.’ I said, ‘It’s okay. I’m at the Baton Rouge. I can be parked here.’ He said, ‘No. It’s for not having your car doors locked,’” Carriere said.

Gatineau police have issued 467 tickets for unlocked cars so far in 2017. Last year, they issued 517.

Sgt. Jean-Paul Le May said the law is designed to reduce crimes of opportunity such as vehicle break-ins.

“We call out to all citizens to help us prevent crime,” he said. “An easy way to prevent crime is starting by locking your doors, whether it’s from your car or your house.”

Carriere took to Facebook to vent his frustration. In a post, he said he tried to explain to the officer that he was only in the restaurant for two minutes before returning to lock the car.

“He (the officer) said ‘too late’ and he was just doing his job,” Carriere wrote. “Instead of catching people breaking into cars they are punishing people who are not committing a crime. And in my case, someone who was in the process of complying with a bylaw I did not know existed.”

Carriere said he is not sure if he will fight the ticket. If he loses, he will have to pay an additional $89 in court fees.

He wrote in the Facebook post that the incident has made him less eager to spend time in Gatineau.

“Ah, the nanny state. Next time I visit I will lock the doors but leave the windows rolled down. As I read it, that is not technically illegal,” Carriere wrote. “Any other stupid bylaws I should be aware of?”

With a report from CTV Ottawa’s Joanne Schnurr