An Italian man opened fire on African migrants in the central city of Macerata, injuring six people in the racially motivated attack before he was captured, police said.
The shootings happened just days after a Nigerian migrant was arrested in connection with the death of an 18-year-old Italian woman, whose dismembered body was discovered hidden in two suitcases near Macerata.
Police named the suspected shooter as 28-year-old Luca Traini and said he had an Italian flag draped over his shoulders when he was seized in the street by armed police.
A pistol was found in his nearby car.
Police said one of the six victims was seriously hurt and needed surgery, but gave no further details.
The ruling centre-left Democratic Party (PD) said Mr Traini had stood as a candidate for the rightist Northern League at local elections last year and accused him of also firing shots at one of their offices in Macerata before he was arrested.
The League backs fiercely anti-immigrant policies and is part of ex-prime minster Silvio Berlusconi's centre-right alliance that is leading in the polls ahead of a 4 March national election.
League leader Matteo Salvini distanced himself from the shooting, but said unrestrained immigration was causing social strife.
"I can't wait to get into government to restore security, social justice and serenity to Italy," he said.
We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences
PD leader Matteo Renzi called for calm. "The man who fired the gun, hitting six people of colour, is a squalid, mad person. But the state is stronger than him," the former prime minister wrote on Facebook.
Police said the shooter drove around Macerata, which is famed for its outdoor opera festivals, in a black Alfa Romeo car firing out of his window at migrants in various locations.
With police closing in, he tried to escape on foot but was almost immediately caught.
Local media said he shouted, "Long live Italy," as he was taken away.
Tensions in Macerata had risen this week following the gruesome discovery of Pamela Mastropietro's body.
The teenager had run away from a drug rehabilitation centre last Monday and met a Nigerian asylum seeker, Innocent Oseghale, the next day.
Her body was found on Wednesday and a preliminary post mortem could not immediately identify the cause of death.
Witnesses said they had earlier seen Mr Oseghale with the suitcases. He refused to talk to the police after his arrest.
Newspapers said he was denied asylum last year but had remained in Macerata to appeal against the decision.
More than 600,000 mainly African migrants have reached Italy by boat over the past four years.
The centre-right bloc, which includes the League, says the vast majority have no right to asylum and has promised mass expulsions if it takes power.
Leftist parties have ruled out any such deportations.