Baltimore placed Hammel on the 15-day disabled list Sunday.
"I can't keep pitching on a bad leg," he said. "I start feeling things with my arm and hurting stuff there. I'm obviously bummed out."
Hammel's knee has been bothering him since May, but the injury became more serious Friday night when he was forced to leave a game against Detroit after throwing a pitch in the fourth inning.
"It's a decision that had to be made," he said. "It's not easy because I could rest for maybe a week and it might go back to where it was. Then you run the risk of it happening every time I go out there."
Obtained in a December trade with Colorado, Hammel (8-6, 3.54 ERA) leads Baltimore in wins and strikeouts (106). The right-hander is one of the main reasons why the Orioles have become a playoff contender following 14 consecutive losing seasons.
"Obviously I want to help the club but it's another opportunity for someone to help out," he said. "I'll get back to doing my thing when I get back."
Hammel estimated his recovery at three to four weeks, but manager Buck Showalter said that was optimistic.
"You can't really tell until you get in there," the manager said.
Hammel had an MRI on Saturday that revealed loose cartilage, and that persuaded him to have the operation.
"Get the cartilage that's floating around and see if there's anything else that we haven't caught," he said.
To fill Hammel's spot on the roster, the Orioles recalled reliever Steve Johnson from Norfolk.