Hamels allowed three runs in 5 1/3 innings and left trailing by two runs, in danger of earning his second loss in 15 starts with the Rangers (6-5).
With J.J. Hardy and Matt Wieters on first and third with one out, Rangers manager Jeff Banister called for right-hander Tom Wilhelmsen to face Jonathan Schoop, who promptly hit into one of two double plays started by the Texas infield, this one started by shortstop Elvis Andrus.
Despite surrendering the winning runs to Seattle on Wednesday, the Rangers' bullpen is in the midst of a good run. In its last eight games, relievers have posted a 1.08 ERA.
"That's exactly how I saw it happening," said Wilhelmsen, who earned his first victory of the season. "I'm a pitch-to-contact kind of guy, and I knew if I saw it happening when I was warming up. And ask and you shall receive."
Those key outs and stranded runners seemed to jump-start the Rangers' lineup, as they pounced on Orioles starter Chris Tillman in the bottom half of the sixth.
The Rangers sent nine men to the plate and scored five times on six hits. Mitch Moreland's run-scoring double and Ian Desmond's RBI single tied the game to set up Rougned Odor's tiebreaking two-run double. Andrus added an RBI base hit to cap the outburst.
"I think any time you're able to get out of jams it's huge [for the offense]," Hamels said. "You want to have guys with positive energy anytime throughout a game. You want to have those hitters as excited as possible."
Relievers Keone Kela, Sam Dyson and closer Shawn Tolleson worked three scoreless innings, aided by a handy 4-6-3 double play started by Odor in the eighth.
Odor went to his right to make a back-handed spear on one knee of Matt Wieters' hard-hit ball. An overhand flip to Andrus at second started the inning-ending double play.
Hamels, too, was able to work out of a jam in the fifth with runners at second and third with no outs after Schoop's single and Nolan Reimold's double.
Hamels, though, struck out Joey Rickard and Adam Jones with a Manny Machado groundout sandwiched in between to get out of the inning unscathed.
"I think with these guys, it's go after him," Hamels said on his mind-set facing Machado. "That part of the lineup, you have guys behind him who are just as good. You can't really tread lightly when you get in that part of the lineup."