BALTIMORE -- Manny Machado led off the ninth inning with a single and scored the winning run on a single by Nate McLouth, and the Baltimore Orioles beat the Tampa Bay Rays 3-2 Wednesday night to retain a share of first place in the AL East.
The rookie also made a key defensive play in the top of the ninth for the Orioles, who moved 18 games over .500 (80-62) for the first time since the end of the 1997 season. Baltimore started the day tied atop the division with the New York Yankees, played a late game at Boston.
The Orioles will seek to complete a three-game sweep of Tampa Bay on Thursday.
B.J. Upton homered for the Rays, who fell three games behind the Orioles. Tampa Bay stranded 11 and went 2 for 10 with runners in scoring position.
Machado led off the ninth with a single off Kyle Farnsworth (1-5), took second on a bunt and scored when McLouth hit a liner off the right-field wall. McLouth has assumed the leadoff role in place of Nick Markakis, who broke his left thumb on Saturday.
In the top of the ninth, pinch-runner Rich Thompson was on second with two outs when Evan Longoria topped a pitch from Jim Johnson (2-1) down the third-base line. Machado picked it up and faked a throw to first as Thompson rounded third. Machado flipped the ball to shortstop J.J. Hardy at third base, starting a rundown that ended with Thompson being tagged out by catcher Matt Wieters.
Orioles starter Miguel Gonzalez allowed two runs, six hits and five walks in six innings. He yielded a leadoff home run for the third time this season, but finished by retiring Jose Molina with the bases loaded with score 2-all.
Tampa Bay right-hander Alex Cobb gave up two runs and seven hits in 4 2-3 innings. He's 5-0 with three no-decisions in his last eight starts.
Cobb was followed by Jake McGee, who struck out all four batters he faced in his 17th straight scoreless appearance.
Upton hit the second pitch of the game into the left-field seats, his eighth career leadoff homer and third this year.
In the bottom half, after RBI singles by Wieters and Wilson Betemit gave Baltimore a 2-1 lead, Cobb struck out Mark Reynolds with one out and runners on second and third. A walk loaded the bases for Machado, who hit into a fielder's choice.
Through the first two innings, Baltimore was 2 for 8 with runners in scoring position.
Ben Francisco tied it for Tampa Bay with a two-out RBI double in the third. Carlos Pena then hit a routine fly ball with two runners in scoring position.
The Rays threatened in the sixth. A single, a walk and a balk put runners at second and third with one out before Gonzalez struck out Ryan Roberts. An intentional walk loaded the bases for Molina, and the crowd of 26,076 stood in anticipation when the count reached 1-2. Molina fouled off a pitch before hitting a grounder to first.
NOTES: Tampa Bay OF Desmond Jennings (lower back tightness) was available to play but did not start after missing the previous three games. ... Rookie LHP Wei-Yin Chen (12-9) starts for the Orioles on Thursday afternoon. The Rays will start Jeremy Hellickson (8-10), who's winless since Aug. 20. ... Roberts, who strained his left forearm Tuesday night, started at 2B. ... Reynolds struck out three times. ... Upton reached 30 steals for the fifth straight season.