The foundation for a lopsided Rays win began to crumble in the eighth, when the Orioles scored three against Jeremy Hellickson before Kyle Farnsworth took over with a runner aboard and two outs.
J.J. Hardy greeted the veteran right-hander with a single to left, then Chris Dickerson homered to right. And in an instant, the Rays' eight-run lead had dwindled to two.
After Yamaico Navarro singled, Joel Peralta relieved Farnsworth and put out the fire by retiring Nate McLouth on a flyout to left. Still, the Orioles biggest single-inning output of the season put them in position to complete the comeback in the ninth; only Peralta would not allow that to happen.
With Fernando Rodney warming in the bullpen a night after blowing a save in the ninth against the Red Sox in a 4-3 Rays loss, Peralta returned to pitch the ninth and retired Manny Machado, Nick Markakis and Adam Jones in order to earn the save and preserve the photo-finish win.
"Big, big [to come through with a win]," Peralta said. "We've been shaky a couple of times and we're getting back to what we really think we can do. Save the lead, hold the lead for the guys that win this game, the guys hitting and doing a great job. We've been blowing some games. Tonight was really special for me."
The tourniquet Peralta applied to the Rays' gushing vein was much appreciated inside the team's clubhouse. Kelly Johnson spoke of the calm the veteran right-hander brings to any situation, no matter how hot.
"Joel doing stuff like that and having that ability is obviously a very comforting feeling for everybody else," Johnson said.
Johnson also noted that the Orioles had a lot to do with the furious comeback they mounted in the eighth.
"You've got to give them a little bit of credit," Johnson said. "They strung together some good at-bats and got some big hits themselves. Three-run homer by Dickerson is huge. They're an unbelievable offensive team.
"But at the same time, those are tough situations, you get a big lead like that, it's pretty easy to let your guard down."
Regardless of the journey, the Rays arrived at the desired destination Friday night, giving the team its seventh win in nine games while moving it to 21-20 on the season.
Happily for the Rays, they did not have to endure the emptiness of blowing the lead in the seventh inning or later for the ninth time this season.
"I think it would have been horrific in baseball terms [had the Rays lost]," Rays manager Joe Maddon said. "We've lost some huge leads. We have. But have bounced in a good way. That's the one part about baseball that's the most devastating within a group is to lose leads late, often. That's not good."
Early on, the game looked like a highlight reel for the Rays' offense, which has now scored 158 runs in its last 28 games.
Baltimore held a 3-1 lead heading into the third when the Rays notched their first of two four-run innings. Johnson had the big blow when he reached the seats off Orioles starter Jason Hammel with two aboard.
The Rays rested their bats in the fourth before getting busy again in the fifth to mint their second four-run inning. Johnson had an RBI single to get things started, Yunel Escobar doubled home another run and Desmond Jennings singled to drive home two, putting the Rays up 9-3.
For good measure, the Rays added three in the sixth -- highlighted by Escobar's two-run single -- to push the lead to 12-4.
"They're good hitters," Orioles manager Buck Showalter said. "They've been swinging the bat well and you saw that tonight. It seemed like everything they put in play was out of our reach."
Johnson had four RBIs, and finished with three hits in five at-bats and was a triple shy of the cycle to highlight the Rays' 17-hit attack that saw all of the team's starters get at least one hit.
"Momentum definitely carried in our favor for most of that game," Johnson said. "Guys were hitting, hitting with runners in scoring position. ... When you're doing that as a team, it makes it really hard for the other team."