Updated

Nate McLouth's hit in the bottom of the ninth inning sent the Baltimore Orioles past the Tampa Bay Rays, 3-2, in the middle test of a three-game series from Camden Yards.

Kyle Farnsworth (1-5) served up a leadoff single to Manny Machado, and Robert Andino sacrificed him to second. McLouth stepped in and drilled a line drive to right which bounced off the wall several feet inside the foul pole, allowing the winning run to score easily.

"He's a baseball player and he can hit," Orioles manager Buck Showalter said about McClouth. "He enjoys the competition and you can see it. He's constantly engaged in the action."

The hit made a winner of Jim Johnson (2-1), who allowed two hits in the top of the ninth but kept the game deadlocked.

Matt Wieters and Wilson Betemit drove in a run each for the Orioles, who have won the first two games in the series and seven of their last 10.

Baltimore remained in a tie atop the AL East after the Yankees pulled out a 5-4 win in Boston later Wednesday.

B.J. Upton homered and Ben Francisco added an RBI single for the Rays, who have dropped four of their last six. Tampa Bay has fallen three games behind the Yanks and O's.

Upton began the game with a homer to left, but the O's struck back with two in the home half on back-to-back RBI singles from Wieters and Betemit.

Tampa tied the score in the third, as Jeff Keppinger singled with one out, moved up on an Evan Longoria base hit and scored on a Francisco single.

Baltimore stranded two in the eighth, failing to break the deadlock after a double from Wieters and walk to Mark Reynolds.

The Rays could have taken the lead in the ninth, but Rich Thompson, who was a pinch-runner for Keppinger, was caught in a rundown between third and home on an infield hit by Longoria.

Machado, who snagged the ball on the infield grass, faked a throw to first then tossed behind the runner, who was eventually tagged out by Wieters.

"They got the big hit and we didn't. That's what it comes down to," Rays manager Joe Maddon said about the ninth inning. "We have to figure out a way to score a run there."

Game Notes

Baltimore has won eight of 14 over Tampa in the season series ... Orioles starter Miguel Gonzalez allowed six hits and two runs, with five walks and four strikeouts over six innings, while Rays hurler Alex Cobb departed after 4 2/3 frames, serving up seven hits and two runs while fanning six ... A win tonight put the Orioles 18 games over .500 for the first time since the end of the 1997 season ... Upton, who also stole a base, reached the 30-steal mark for the fifth consecutive season.