Alex Rodriguez hit a three-run homer in the ninth inning, his second of the game, and the New York Yankees rallied for a 4-3 victory over the Baltimore Orioles on Friday night.

Trailing 3-1, Jorge Posada led off the ninth with a single off Koji Uehara (1-2) and went to second on Curtis Granderson's one-out single. Mark Teixeira popped out and the Yankees were down to their last strike before Rodriguez hit a 2-2 fastball into the stands in left-center.

The Yankees posted their 46th come-from-behind victory of the season and improved to 2-5 on their nine-game road trip. They moved back into first place in the AL East, one-half game behind Tampa Bay, which lost 4-3 to Los Angeles on Friday.

David Robertson (4-4) worked a scoreless eighth.

Adam Jones and Robert Andino homered for Baltimore.

Mariano Rivera got the final three outs for his 31st save.

Yankees starter A.J. Burnett yielded three runs and six hits over seven innings. He walked one and struck out five.

Baltimore's Kevin Millwood allowed a run and five hits over seven innings, walking four and striking out six.

Rodriguez led off the second inning with his 24th homer, connecting to left-center on an 0-1 pitch.

The Orioles tied the game in the third when Cesar Izturis was hit by a pitch, stole second, moved to third on Brian Roberts' groundout and scored on a sacrifice fly by Nick Markakis.

Jones hit a one-out solo shot to center to make it 2-1 in the fourth. It was his 19th homer, matching a career high.

In the seventh, Andino hit a line-drive homer to left, his first of the season.

NOTES: OF Nick Swisher was out of the Yankees' starting lineup for a fifth straight game with a sore left knee. He grounded out as a pinch-hitter in the eighth. ... Two days after he feigned being hit by a pitch against Tampa Bay, New York SS Derek Jeter still thinks the attention the incident received is unwarranted. "What am I supposed to do? Say, 'Sorry, sir, but it didn't hit me. Please let me continue to hit?' ... The umpire called it, not me," Jeter said. ... When Rodriguez homered in the first, fireworks were mistakenly shot off from the scoreboard in right-center. ... Millwood did not allow a first-inning run for the sixth time in his last 20 starts. ... Greg Colbrunn, manager of the Yankees' Single-A Charleston affiliate, has joined the major league coaching staff and will be with the team through Sept. 23.