Hamels suffered the injury in the first inning of Friday's game against the Cincinnati Reds.
"It felt more like a cramp," Hamels said after the 6-3 loss. "Continued to throw the next two pitches, and it still was lingering."
Chicago also designated outfielder Carlos Gonzalez for assignment and recalled right-handed pitchers Dillon Maples and Rowan Wick.
On Friday, Hamels came out for the second inning, but after throwing one warm-up pitch, he immediately walked off the mound, telling Cubs manager Joe Maddon he was done.
"It was grabbing again, so I knew that's not always good, and you could injure yourself a lot more by trying to play through it," Hamels said.
He is set to undergo an MRI on Monday in Pittsburgh.
The 35-year-old suffered an oblique injury two years ago, so he will let that guide him in his recovery. One thing is for sure: He won't rush back.
"I came back probably a week earlier than I should've," Hamels said of his 2017 injury. "I don't think it's going to be as bad, but I know after experiencing it once, and seeing what type of results I was continuing to put up, that's not going to be any sort of good scenario to repeat that."
Mike Montgomery took over for Hamels and was greeted with a first-pitch home run by Reds outfielder Phillip Ervin. Three relievers followed him.
The Cubs' bullpen was already taxed after a short outing by Tyler Chatwood on Thursday, likely the reason why they called up two fresh arms for Saturday's contest. Teammates could be seen shaking hands withGonzalez and giving him hugs after Friday's game. Gonzalez had a .606 OPS in 49 plate appearances after being signed about a month ago.
As for who replaces Hamels in the rotation, the Cubs are deeper in that area than previous seasons. Chatwood could get the nod, while rookie Adbert Alzolay is likely to stick with the team longer now as well. The team also expects injured righty Kyle Hendricks to return shortly from a shoulder ailment.
"We can plug in," Maddon said. "Guys are stretched out, guys are ready. This time of the year, crazy stuff always seems to happen right before the break and sometimes right after. We are prepared for it. We have the depth to deal with it."
As for Hamels, he was on a roll until getting injured, sporting a 1.00 ERA in June before giving up a first-inning run on Friday. Based on his month, he had a good chance of making the All-Star team, which will be announced Sunday.
"That will be something that could be tough," Hamels said of missing out. "This [the injury] could easily deter the opportunity. It's a tough thing."
Hamels leaves after warming up in 2nd inning
Cole Hamels exits Friday's game after throwing a warm-up pitch before the second inning against the Reds.