Hamels had just allowed a two-run home run to Ryan Braun to give the Brewers a 2-0 lead. Before Braun's at-bat, Hamels had retired nine of the first 10 batters he faced. He had struck out six.
The injury was listed as a left shoulder contusion.
Hamels entered Thursday 0-1 with an 11.17 ERA in his first two starts.
Todd Zolecki is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.