A picture showing a man identified by the Italian Carabinieri, paramilitary police, as Luca Traini. (ANSA via AP)

Rome - Luca Traini, an Italian neo-Nazi sympathizer who earlier this year injured six African migrants in a drive-by shooting that caused nationwide consternation, was on Wednesday sentenced to 12 years' imprisonment.

A court in Macerata, the central Italian town where the crime took place, found the 29-year-old guilty of attempted massacre, aggravated by racist motives, and illegal possession of a weapon, the ANSA news agency said.

On February 3, the 29-year-old Traini drove around Macerata shooting at black people, in what he said was an act of revenge for the local murder of an 18-year-old female heroin addict. A Nigerian drug dealer has been accused of the woman's murder.

Traini is an unemployed body builder, with a neo-Nazi tattoo on his forehead. At the end of his rampage, police arrested him on the steps of a military monument, where he stood draped in the Italian flag, holding up his arm in a Fascist salute.

Wednesday's first instance ruling, which can be appealed, was in line with what the prosecution had asked for. Traini opted for a fast-track trial, which allows for more lenient sentencing.

In a statement before the court retired to deliberate, Traini said he was not mentally unstable, and denied any racist intent. "They tell me I am crazy or borderline but I only had a difficult childhood," he said according to ANSA.

The Macerata shootings poisoned the national debate on migration during the campaign for March 4 general elections, which have led to the formation of a populist, anti-immigration government comprising the nationalist League and anti-establishment Five Star Movement.