A German court on Thursday sentenced a truck driver to 10½ years in prison for shooting hundreds of times from his cab at other vehicles.

In more than 700 such attacks from 2008 to 2013, the 58-year-old, dubbed the "Autobahn gunman" by German media, injured several people, one of them a woman he shot in the neck, and damaged hundreds of vehicles.

After his arrest, he told police he had wanted to punish his victims for bad driving.

The Wuerzburg district court found him guilty of four counts of attempted murder, grievous bodily harm and dangerous interference with traffic.

Presiding Judge Burkhard Poepperl said the sentence was relatively harsh, but people could not be allowed to take the law into their own hands.

Prosecutors described the driver as a "frustrated loner" who hated people and liked guns. The man said he had been upset about increasing aggression in traffic, but had not wanted to hurt anybody.