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 Luca Traini, 28, 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.
"He drove around in his car and when he saw any coloured people he shot them," Marcello Mancini, a Macerata resident, told Reuters television. 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 Traini had stood as a candidate for the rightist Northern League at local elections last year and accused him of also firing shoots at one of their offices in Macerata before he was arrested.
The League backs fiercely anti-immigrant policies and is part of ex-prime Silvio Berlusconi's centre-right alliance that is leading in the polls ahead of a March 4 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.
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 by foot but was almost immediately caught. Local media said he shouted, "Long live Italy," as he was taken away.
Her body was found on Wednesday and a preliminary postmortem could not immediately identify the cause of death.
Witnesses said they had earlier seen 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.
"What was this worm still doing in Italy?" Northern League leader Salvini wrote on Facebook at mid-week, accusing the centre-left government of responsibility for Mastropietro's death for allowing migrants to stay in the country.
"The left has blood on its hands," he wrote.
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.
"The news from Macerata leaves me horrified and shocked. We must stop this spiral of hate and violence," said Pietro Grasso, who is the head of the Free and Equal party.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Election Results for Lok Sabha Election 2019 will be out on May 23. Get the latest election news and live updates on ndtv.com/elections. Catch all the action on NDTV Live. Like us on Facebook or follow us on Twitter and Instagram for news updates from each of the 543 parliamentary seats for the election 2019