The Rossoneri's fixture against a fourth-division club was abandoned due to prejudiced jeers emanating from the hosts' support
The former Ghana international was dribbling down the flank after 25 minutes of play in front of a section of the stand populated by the opposition's fans.
He then suddenly stopped playing, picked up the ball, and kicked it towards the Pro Patria support, prompting further jeers from the home crowd.
The referee decided to abandon the match a minute later.
Rossoneri organising director Umberto Gandini was quick to praise his players for walking out on the match.
"Very proud of the Milan players who decided to walk off the pitch today for racist abuse from few idiots," he wrote on Twitter.
"No racism, no stupidity!"
Two other players, M'Baye Niang and Sulley Muntari, were also singled out for taunts due to their race during the match.
Milan get back to action after the winter hiatus with a home clash against Siena on Sunday.