BALTIMORE -- James Shields' outing quickly went from dominant to disappointing during the fifth inning on Thursday.
After keeping the Orioles quiet for four frames, the right-hander pitched his way into trouble in the fifth. So many times he was one pitch away from limiting the damage, and in nearly every at-bat the O's hitters battled back.
Nick Markakis, Jim Thome, Adam Jones and Matt Wieters all faced 0-2 counts before eventually reaching base in the five-run frame that propelled the O's to a 6-2 victory, preventing the Rays from finishing a sweep at Camden Yards.
"[Shields is] throwing well, it's just kind of exasperating for him not being able to put hitters away in those moments when he normally is able to do so," manager Joe Maddon said. "There's these little command issues with him that normally do not occur."
With the win, the Orioles claimed sole possession of second place in the American League East and, at least momentarily, halted the Rays' ascension up the division and Wild Card standings.
"It's disappointing," Shields said. "We had a chance to sweep the Orioles right there. But we won two out of three, so that's good."
Not so good was Shields' fifth frame, which put the Rays' offense in a hole too big for it to climb out of.
Markakis led off with a single, J.J. Hardy was hit by a pitch and Thome walked to load the bases for Jones, who grounded a single through the left side to give the O's a 2-0 lead.
After Wieters walked to load the bases again, Chris Davis cleared them with a double to the gap in left-center.
On a humid afternoon that crept up above 95 degrees by day's end, Davis saw Shields tiring in the 29-pitch frame.
"I just think we kind of wore him down," Davis said. "We kind of started stringing stuff together and putting pressure on him, and we were able to get the big hits. I think that was really the back-breaker for him."
"The longer you stand out there, the more the heat is going to get to you," Shields said. "But this is why we play baseball."
Shields retired five of the next six batters after the Davis double, finishing his outing with a line of five runs on six hits and five walks in six innings.
Shields' five walks were a season high, while his 10 strikeouts came up just one shy of his highest total of the year.
"It came down to two hits and me walking too many guys," Shields said. "I felt I was executing my pitches for the most part all day, besides the walks."
The Rays attempted to mount a rally in the seventh, as Ryan Roberts led off with a walk and Carlos Pena doubled on a fly ball that carried over the head of left fielder Davis.
Sam Fuld plated them both with a double to the gap in left-center field, the highlight of a 3-for-4 day and 5-for-9 series in his first action of the year.
Fuld said the opposite-field double was a sign that he had his timing back, even as he had to pay more attention to his diabetes in the grueling heat.
"When you're using the other field, that means you're putting good swings on the ball, and that's definitely the case for me," Fuld said. "Obviously I didn't expect to necessarily get that many hits that soon, but I was just confident going in that I'd have some good at-bats."
But Fuld's double turned out to be all the scoring the Rays could muster.
Jose Molina struck out and Elliot Johnson reached on an error before Desmond Jennings popped out on the infield and B.J. Upton lined out to left.
The Rays finished 1-for-12 with runners in scoring position, allowing O's starter Chris Tillman to escape after yielding only two runs in six-plus innings, despite putting a runner on base in every frame except for the third.
The Orioles also turned four double plays, as the Rays forfeited a chance to get to Tillman early with double-play groundouts after the leadoff man reached in the first and second innings.
"We didn't have great swings on him," Maddon said. "We didn't hit the ball hard against him. The ball wasn't properly struck. I thought the way the ball seemed to be carrying to left field, it would be nice to get some balls in the air, but we couldn't even do that."
The Rays' final chance to rally came in the ninth, when Pena and Fuld hit back-to-back singles against Orioles closer Jim Johnson.
But pinch-hitter Jose Lobaton grounded into yet another double play before Jeff Keppinger grounded out to short to cap the loss and put an end to an otherwise strong series.
"It was their day today, it was not our day," Maddon said. "To win two out of three and pick up a game, had you told me before we came here that that would've happened, I would have said, 'I'm signing up for that right now.'"
Greg Luca is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.