It was just over a month ago when the Baltimore Orioles summoned 20-year-old Manny Machado from the minor leagues and thrust him into the middle of a pennant race.

The kid hasn't felt the pressure yet. To the contrary, Machado is hitting in the clutch, playing third base as if he's done it all his life and making heady decisions that leave opponents shaking their heads.

Machado made a brilliant defensive play in the top of the ninth and scored the winning run in the bottom half, and the Orioles beat the Tampa Bay Rays 3-2 Wednesday night to retain a share of first place in the AL East.

Nate McLouth drove in the decisive run 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, who won 5-4 at Boston.

In the Tampa Bay 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.

"I was trying to get Evan out to be honest, but then when I came up I saw I had no chance," Machado said. "So I did a pump-fake and tried to deke the runner. It was just natural. I just came out and didn't think about it."

What made the play even more impressive is that Machado is a converted shortstop. He was moved to third base because the Orioles have Hardy at shortstop.

"He was smart. I don't know if he would have been able to throw out Evan," Hardy said. "I know (Longoria) is running a little slow with his hamstring, but for Manny to do what he did, it just shows you how aware he is at 20 years old. I think he's really impressed me."

Those in the opposite dugout felt the same way.

"His poise and his calmness, he's not taken in by the moment at all," Tampa Bay manager Joe Maddon said. "That was an example of his calmness right there. He's really aware of everything that's going on around him. For him to do that in that situation is impressive. He has the maturity of a veteran."

Thompson added, "I was prepared for him to go to first, wasn't prepared for Hardy to be backing up. It certainly is one of those plays you will never forget. Certainly never happened to me before."

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.

"We have to get some offense somewhere," Maddon said. "Our defense has gotten better. Our pitching is outstanding, The offense kind of comes and goes. That's the bad part. Our inability to get the hit when we need it."

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.

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.