Local news outlets said the man was detained after he stepped out of his black Alfa Romeo 147 near the memorial, gave a fascist salute, and shouted "Italy for the Italians". It was not clear whether the victims were Italian citizens.
After the attack, Italian Prime Minister Paolo Gentiloni called on political leaders on all sides to stop a "cycle of violence".
He said: "Let's stop this risk, let's stop it now, let's stop it together," in a nationally televised statement from his residence, the Palazzo Chigi, in Rome. "Hate and violence won't be able to divide us."
More than 620,000 migrants, many of them African, have arrived in Italy since the beginning of 2014, contributing to a growing sense among Italians that the country was taking in far more people than it could handle.
Anti-immigrant sentiment has become a main theme in the campaign leading up to next month's elections. Northern League leader Matteo Salvini has vowed to expel 150,000 immigrants from Italy and close the country's borders to most new arrivals.
The murder in Macerata this past week of 18-year-old Pamela Mastropietro drew national attention to the city of 43,000 and added fuel to the debate on migration. Her dismembered remains were found packed into two suitcases. A 29-year-old Nigerian man, Innocent Oseghale, was charged with her murder.
"What was this maggot still doing in Italy? He wasn't fleeing war, he brought war to Italy," Salvini wrote on Facebook on Friday.
- Washington Post, Telegraph Group Ltd