The incident occurred in the early hours of May 10th 2014 in the centre of Lausanne when officers in an unmarked police car noticed a vehicle reported as being stolen a week earlier, reported 24 Heures.
After cornering the stolen Peugeot 206, a police officer got out of the patrol car and advanced towards it shouting “stop, police” and holding up a police badge.
The driver of the Peugeot, a Tunisian in the country illegally, stamped on the accelerator and drove towards the officer, who drew his weapon and opened fire on the bonnet.
The officer just managed to jump clear of the car and shoot at the rear wheel, the report said, before it sped off, a second police car in pursuit.
A few metres down the road the Tunisian lost control of the car and crashed into a wall, injuring his passenger.
He fled on foot, but was arrested later that day.
In court the defendant claimed that he acted in self-defence, since he felt threatened by the police officer.
But the judge found him guilty of attempted murder in driving deliberately at the officer.
The seven-year sentence also takes into account a sexual offence related to the case.