After repeated chants directed his way, Ghana midfielder Kevin-Prince Boateng picked up the ball and kicked it at a section of the crowd in the 26th minute of the first half.
Boateng then took off his shirt and walked off with his Milan teammates. Urby Emanuelson, Sulley Muntari and M'Baye Niang were also targeted by the chants.
"Walking off was the right choice when faced with something like this," Milan coach Massimiliano Allegri said. "We need to stop these uncivil gestures. Italy needs to improve and become better educated and more intelligent."
"Let's learn from this experience," Allegri added.
The match, which was scoreless at the time, was not resumed. The game was played in Busto Arsizio, a town located north of Milan. Pro Patria plays in Italy's fourth-tier division.
"Shame that these things still happen... (hash)StopRacismforever," Boateng said on Twitter.
Pro Patria defender Devis Nossa said about a dozen fans were involved in the chanting.
"When we tried to reason with them and went under the stands they didn't even consider it," he said. "They certainly weren't our usual fans."
Milan said on its website that the insults came from a small group of Pro Patria fans, adding that the rest of the supporters disassociated themselves from the chants.
The Italian football federation (FIGC) announced an immediate inquiry, but said "no sanction or penalty can erase the disdain for an unjustifiable and intolerable episode."
"We need to react with strength and without silence to isolate the few delinquents that transformed a friendly match into a mess that offends all of Italian football," the FIGC said in a statement.
Milan, returning from its holiday break, is preparing to play Siena on Sunday.
Despite the incident, Milan captain Massimo Ambrosini promised the squad would return to Busto Arsizio.
Italian players' association president Damiano Tommasi applauded Milan's decision to walk off.
"It was a nice signal, even if a sporting event should never be placed in doubt by acts like these," Tommasi said.
Incidents of racism in football have occurred across Europe in recent months. In England, there have been several arrests among fans for at Premier League matches, while Liverpool striker Luis Suarez and Chelsea captain John Terry have served bans for racially abusing opponents.
In October, Serbian fans directed monkey chants at black England players in a European under-21 match that ended in a brawl between players and coaches from both teams.
Last month, fans of Russian champion Zenit St. Petersburg issued a petition calling for non-white and gay players to be excluded from the team.Suggest a correction