At least four people were injured, all of them black foreigners, according to reports.
Italian police said that a suspect was arrested about two hours after he began a shooting rampage from inside a black car.
Residents had been told to stay inside during the shooting and public transport was halted.
Macerata, which has a population of 43,000 people, was the scene of the murder of a white Italian woman earlier this week. her remains were found in two suitcases.
More from World
Killer John Battaglia taunts ex-wife as he is given lethal injection for shooting their daughters
Cape Town drought hurts key tourism industry
‘Talk is cheap’: FBI boss hits back after Trump releases controversial memo
‘Bias’ memo and Trump’s full-throttle battle with FBI risks wrecking public faith in 2016 election
Smolensk crash: Explosions on board before plane hit ground, investigator says
‘Pornographic dancing’ group being extorted by Cambodian authorities, say families
The chief suspect in that case is a Nigerian.