"It was a pitcher's duel, as advertised," Phillies manager Ryne Sandberg said.
Wainwright kept the Phillies off-balance all day, allowing just the one run on six hits, two of which were by Hamels.
"My goal always is to have the hitter not know what pitch I will throw to what quadrant," Wainwright said.
Hamels, who had a 0.30 ERA in four previous June starts, allowed just two earned runs and three overall, but there was a question as to whether he should have gone out in the eighth inning with the score tied at 1. At that point, Hamels had already thrown 107 pitches, and with a relatively well-rested bullpen on a 92-degree day, it seemed like a spot for a change.
After the game, Hamels declined to talk to reporters, so it was left to Sandberg to discuss the decision. He conceded there was a thought of taking Hamels out.
"He threw 94 pitches his last outing, and we were checking with him," Sandberg said. "He was still throwing the ball good, had good stuff, felt strong, and still felt he had 12-15 pitches to play with."
Matt Carpenter opened the inning with a walk. After Allen Craig flew out to center, Matt Holliday hit a 2-2 change-up to left-center field for an RBI double.
"I think that pitch to Holliday was a little bit up, and that first batter he walked [was tough], but I thought Cole was fine and strong today," catcher Carlos Ruiz said.
Hamels threw 120 pitches, the fourth time he has thrown 120 or more this year.
Jake Diekman relieved and hit Yadier Molina, and the runners advanced to second and third on a passed ball.
Jhonny Peralta then hit a grounder to short. Jimmy Rollins came home with a throw that bounced but was dropped by Ruiz while he attempted to tag Holliday. It was ruled a fielder's choice.
Matt Adams knocked in the fourth run with a sacrifice fly to right.
Hamels' streak of 242/3 scoreless innings was snapped in the second inning. Molina led off with a walk and advanced to third on Peralta's double before scoring on a sacrifice fly to right by Adams.
Cody Asche led off the Phillies' third with a single. With the Cardinals expecting Hamels to bunt, he foiled the plan by swinging away and hitting a single into right field. Asche then scored on Rollins' sacrifice fly to deep center. In the fifth, Hamels hit a one-out double to center.
Rollins extended his hit streak to 15 games with a leadoff single in the eighth. He hit a shot to first which Adams almost caught with a diving stab. The ball deflected off his glove toward second, and it was ruled a hit. Rollins has exactly one hit in each of the 15 games.
The Cardinals were then able to answer in the bottom of the inning, ending the Phillies' good fortune on the road.