A judge has cleared a Montreal driver of obstruction charges after the man was caught flashing his headlights to warn other motorists of a police speed trap.

Sandro Ianni had recently parked his vehicle on Marien Boulevard in east-end Montreal near a speed trap set up by local police.

When officers noticed that cars were slowing down ahead of them, an officer went to check out why.

The officer found Ianni flashing his vehicle's headlights, a well-known signal to warn other motorists of police in the area.

The officer gave Ianni a ticket for obstructing a police operation. Ianni contested the ticket.

In Quebec municipal court in Montreal, Ianni admitted to flashing the warning to encourage motorists to slow down.

Judge Denis Laberge found Ianni not guilty, comparing what he did to a radio announcer who gives listeners a head's up that a police operation is underway on a specified street.