Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

MILAN — A right-wing Italian gunman shot and wounded six African immigrants in a two-hour drive-by shooting spree Saturday, terrorizing a small Italian city where a Nigerian man was arrested days earlier in the gruesome killing of a teenager, police said.

Police officers stand guard as forensics officers carry out investigations in the area following the wounding of several foreign nationals in a drive-by shooting at Macerata, on Feb. 3, 2018. Giuseppe Bellini / AFP - Getty Images

The shooting suspect was identified as Luca Traini, a 28-year-old Italian with no previous record. Traini had run for town council on the anti-migrant Northern League's list in a local election last year in the town of Corridonia, but the party lost.

The news agency ANSA quoted friends of his as saying Traini had previously been affiliated with Italian extremist parties like the neo-fascist Forza Nuova and CasaPound.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

As the violent attack unfolded in the central city of Macerata, police told residents to stay inside and ordered a halt to public transport to limit the casualties.

A video posted by the il Resto di Carlino newspaper later showed the suspect with an Italian flag draped over his shoulders being arrested by armed Carabinieri officers in the city center, near where he apparently fled his car on foot. Italian news reports said a gun was found inside the car and the suspect did a Fascist salute as he was arrested, but no salute was visible in the video.

Related: Resurgent far-right leaves Germany's political elite in disarray

The shooting spree came days after the slaying of 18-year-old Pamela Mastropietro and amid a heated electoral campaign in Italy where anti-foreigner sentiment has become a key theme as Italy struggles with large numbers of migrants coming across the Mediterranean Sea.

Healthcare personnel take care of an injured person after being shot by gun fire from a vehicle, in Macerata, Italy, on Feb. 3, 2018. Reuters

Macerata Mayor Romano Carancini confirmed that six foreigners, all black, were wounded in the shooting spree, and one was left with life-threatening injuries.

"They were all of color, this is obviously a grave fact. As was grave what happened to Pamela. The closeness of the two events makes you imagine there could be a connection," Carancini said.

Mastropietro's dismembered remains were found Wednesday in two suitcases two days after she walked away from a drug rehab community. A judge on Saturday confirmed the arrest of the main suspect, identified as 29-year-old Innocent Oseghale.

ANSA reported that the black car used in Saturday's shooting spree had been seen in the area where the woman's body was found and also near where the suspect lived.

Italian Premier Paolo Gentiloni said Italy would be "particularly severe against whoever thinks of nourishing this spiral of violence."

"We will stop this risk. We will stop it right away. We will stop it together," Gentiloni declared.