BALTIMORE (AP) -- J.J. Hardy singled in the tiebreaking run in the seventh inning, and the Baltimore Orioles beat the Tampa Bay Rays 5-4 Thursday night to lengthen their lead in the AL East.
Steve Pearce homered for the Orioles, who took three of four from the sinking Rays. The victory, combined with the Yankees' loss to Detroit, put Baltimore seven games ahead of New York with 30 games remaining.
With the score 4-all in the seventh, Nelson Cruz doubled with two outs off Kirby Yates (0-2). After Chris Davis received an intentional walk, Hardy hit an opposite-field bloop to right that gave the Orioles their first lead.
Andrew Miller (4-5) pitched 1 2-3 hitless innings and Zach Britton worked a perfect ninth for his 29th save.
Evan Longoria homered and drove in two runs for the Rays, who lost their second road series in the last 11. It was a rough night for Tampa Bay shortstop Yunel Escobar, who made two errors, went hitless and was struck in the hand with a pitch.
Tampa Bay used a two-run fifth to take a 4-2 lead. Longoria followed two singles with a sacrifice fly and James Loney hit an RBI double.
The Orioles loaded the bases with one out in the bottom half and tied it when Escobar threw wildly to first base trying to complete a double play.
Earlier, Baltimore also answered a two-run uprising with one of its own.
For the fourth time in the series, the Rays scored first, this time in the first inning against Bud Norris. After Matt Joyce delivered a sacrifice fly, Longoria hit his 17th home run.
In the bottom half, Pearce hit a solo shot and Adam Jones stole home after Cruz forced a rundown by breaking for second base. It was Baltimore's first steal of home since Robert Andino did it in June 2009.
Rays: OF David DeJesus (left hand fracture) is 5 for 17 in seven games on his rehabilitation assignment and "is close to being ready," manager Joe Maddon said.
Orioles: 3B Manny Machado (knee) and C Matt Wieters (elbow) were tending to their injuries Thursday and missed being part of the annual team picture.
Rays: Tampa Bay resumes its contentious rivalry with the visiting Boston Red Sox on Friday night. Chris Archer, who criticized David Ortiz after his home run trot on June 27, starts for the Rays.
Orioles: Miguel Gonzalez (6-7) takes the mound for Baltimore on Friday night in the opener of a four-game series against the Minnesota Twins, the first meeting between the teams since May 4.