NEW YORK — Raul Ibanez lined a tying home run while pinch hitting for slumping Alex Rodriguez in the ninth inning, then hit a leadoff homer in the 12th, giving the New York Yankees a stunning 3-2 win over the Baltimore Orioles on Wednesday night for a 2-1 lead in their AL division series.

Batting for baseball's highest-paid player, Ibanez homered to right-center with one out in the ninth inning off major league saves leader Jim Johnson to make it 2-all. He connected on the first pitch from Brian Matusz in the 12th.

Ibanez became the first player to homer twice in a postseason game in which he didn't start, STATS LLC said.

Phil Hughes will try to clinch it for the Yankees on Thursday night in Game 4 of the best-of-five series. Joe Saunders will start for Baltimore.

Baltimore had won 16 straight extra-inning games, and had been 76-0 when leading after seven, before the Yankees stung them.

"It was a great experience. We do it as a team. We stay after it," Ibanez said. "I'm blessed to come up and have the opportunity like that. We do it together. it's about a team and about winning."

Ibanez got that chance after Yankees manager Joe Girardi made the decision to bat for Rodriguez – the first time A-Rod had ever been pinch-hit for in a postseason game, according to STATS.

Yankees fans had been calling this week for Girardi to get Rodriguez out of the No. 3 spot in the batting order. But Girardi was reluctant to move his fading slugger down in the lineup.

Until he toook him all the way out.

"You have to make some decisions sometimes that are tough decisions. I just had a gut feeling," Girardi said.

Rodriguez has 647 career home runs – he's chasing the all-time record of 762 by Barry Bonds – but was just 1 for 12 with no RBIs and seven strikeouts in this series when Girardi pulled him.

"He said, `Do what you got to do,'" Girardi said, recalled Rodriguez's reaction.

"You're going to be asked a lot of questions if it doesn't work," the manager said.

The brash, young Orioles appeared poised to move within a game of their first trip to the AL championship series since 1997.

But Ibanez hit a 1-0 pitch into the seats in the ninth, setting off a raucous celebration in what had been a demoralized Yankee Stadium crowd. Rodriguez led the cheers, raising an arm in the dugout and high-fiving injured star Mariano Rivera.

"He said great job. A-Rod is a great teammate and great team player," Ibanez said. "He's the first one on the top step congratulating you. It's about winning. It's about the Yankees and continuing."

After their 10-game July lead was cut to zero in early September, the Yankees repelled every Orioles charge. The teams were tied 10 times in the final month but New York ended up atop the division.

New York won the opener in Baltimore scoring five runs in the ninth off Johnson. The Orioles won Game 2 and rode Miguel Gonzalez's pretty performance to a 2-1 lead in the ninth.

But the Yankees limited Baltimore to one hit after Manny Machado homered in the fifth. Ryan Flaherty homered earlier for the Orioles.

Robert Andino was doubled off second after leading off the Baltimore ninth with a single and advancing on a sacrifice.

Boone Logan got one out in relief of Hiroki Kuroda, who gave up two solo homers in 8 1-3 innings. Closer Rafael Soriano pitched 1 1-3 innings and David Robertson went two, finishing off his outing by bumping into and tagging Andino to end the top of the 12th.

Derek Jeter tied the score with an RBI triple in the third for the Yankees. Jeter, limping because of a sore ankle, came out after eight innings.

NOTES: Rivera threw out the ceremonial first pitch.

Loading Slideshow...
  • Raul Ibanez

    New York Yankees' Raul Ibanez follows through on a home run as Baltimore Orioles catcher Matt Wieters watches during the ninth inning of Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Brian Matusz, Raul Ibanez

    Baltimore Orioles pitcher Brian Matusz leaves the field as New York Yankees' Raul Ibanez (27) heads to home plate after hitting the game-winning home run in the 12th inning in Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York. The Yankees won 3-2.

  • Raul Ibanez

    New York Yankees' Raul Ibanez hits a solo home run to tie the game in the ninth inning in Game 3 of the American League division baseball series against the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York. The Orioles catcher is Matt Wieters and the umpire is Brian Gorman.

  • Eric Chavez

    New York Yankees third baseman Eric Chavez competes with fans as he catches a ball hit into foul territory by Baltimore Orioles' Manny Machado for an out during the seventh inning of Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Buck Showalter

    Baltimore Orioles manager Buck Showalter discusses a call with umpire Mike Everitt during Game Three of the American League Division Series against the New York Yankees at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Derek Jeter

    Derek Jeter #2 of the New York Yankees rounds second base after hitting a triple against the Baltimore Orioles during Game Three of the American League Division Series at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Mark Teixeira

    Mark Teixeira #25 of the New York Yankees bats against the Baltimore Orioles during Game Three of the American League Division Series at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Derek Jeter

    Derek Jeter #2 of the New York Yankees reacts after hitting a triple against the Baltimore Orioles during Game Three of the American League Division Series at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Buck Showalter

    Baltimore Orioles manager Buck Showalter discusses a call with umpire Mike Everitt during Game Three of the American League Division Series against the New York Yankees at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Raul Ibanez

    New York Yankees' Raul Ibanez (27) is mobbed by teammates at home plate after he hit the game-winning home run in the 12th inning in Game 3 of the American League division baseball series against the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York. The Yankees won 3-2.

  • Nick Swisher

    Nick Swisher #33 of the New York Yankees reacts after striking out during Game Three of the American League Division Series against the Baltimore Orioles at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Raul Ibanez

    New York Yankees' Raul Ibanez (27) celebrates with teammates as he reaches home plate after hitting the game-winning home run during the 12th inning of Game 3 of the American League division baseball series against the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York. The Yankees won 3-2.

  • Adam Jones

    Adam Jones #10 of the Baltimore Orioles can't catch a ball hit by Derek Jeter of the New York Yankees resulting in a triple during Game Three of the American League Division Series at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Raul Ibanez

    Raul Ibanez #27 of the New York Yankees reacts after hitting a walk off home run in the bottom of the twelfth inning to defeat the Baltimore Orioles in Game Three of the American League Division Series at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Ichiro Suzuki

    Ichiro Suzuki #31 of the New York Yankees throws after making a catch against the Baltimore Orioles during Game Three of the American League Division Series at Yankee Stadium on October 10, 2012 in the Bronx borough of New York City.

  • Hiroki Kuroda

    New York Yankees' Hiroki Kuroda delivers a pitch during the first inning of Game 3 of the Yankees' American League division baseball series against the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York.

  • Mariano Rivera

    New York Yankees' Mariano Rivera throws out the ceremonial first pitch of Game 3 of the American League division baseball series between the Yankees and the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York.

  • Buck Showalter

    Baltimore Orioles manager Buck Showalter walks in the dugout before Game 3 of the Orioles' American League division baseball series against the New York Yankees Wednesday, Oct. 10, 2012, in New York.

  • Jim Thome, Chris Davis

    Baltimore Orioles designated hitter Jim Thome, center, laughs with teammate Chris Davis, right, before Game 3 of the Orioles' American League division baseball series against the New York Yankees, Wednesday, Oct. 10, 2012, in New York.

  • J.J. Hardy

    Baltimore Orioles' J.J. Hardy, right, talks to a teammate during batting practice before Game 3 of the Orioles' American League division baseball series against the New York Yankees on Wednesday, Oct. 10, 2012, in New York.

  • Buck Showalter, Joe Girardi

    Baltimore Orioles manager Buck Showalter, left, and New York Yankees manager Joe Girardi shake hands before Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Miguel Gonzalez

    Baltimore Orioles' Miguel Gonzalez delivers a pitch during the first inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees, Wednesday, Oct. 10, 2012, in New York.

  • Ichiro Suzuki, Derek Jeter, Joe Girardi

    New York Yankees manager Joe Girardi, left, watches as Derek Jeter, second from left, and Ichiro Suzuki, of Japan, greet Eric Chavez (12) as the line-up is announced before Game 3 of the Yankees' American League division baseball series against the Baltimore Orioles, Wednesday, Oct. 10, 2012, in New York.

  • Miguel Gonzalez

    Baltimore Orioles' Miguel Gonzalez delivers a pitch during the second inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees, Wednesday, Oct. 10, 2012, in New York.

  • Adam Jones

    Baltimore Orioles' Adam Jones breaks his bat while grounding out during the second inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees, Wednesday, Oct. 10, 2012, in New York.

  • Ryan Flaherty

    Baltimore Orioles' Ryan Flaherty follows through on a solo home run off New York Yankees starting pitcher Hiroki Kuroda during the third inning in Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York. The Yankees catcher is Russell Martin and the umpire is Brian Gorman.

  • Ryan Flaherty

    Baltimore Orioles' Ryan Flaherty follows through on a home run during the third inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees on Wednesday, Oct. 10, 2012, in New York.

  • Ryan Flaherty

    Baltimore Orioles' Ryan Flaherty swings on a home run during the third inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees on Wednesday, Oct. 10, 2012, in New York.

  • Nate McLouth

    Baltimore Orioles' Nate McLouth hits a single during the third inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees, Wednesday, Oct. 10, 2012, in New York.

  • Derek Jeter

    New York Yankees' Derek Jeter hits an RBI triple during the third inning of Game 3 of the Yankees' American League division baseball series against the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York.

  • Adam Jones

    Baltimore Orioles center fielder Adam Jones chases an RBI triple by New York Yankees' Derek Jeter during the third inning in Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Derek Jeter

    New York Yankees' Derek Jeter hits an RBI triple during the third inning of Game 3 of the Yankees' American League division baseball series against the Baltimore Orioles on Wednesday, Oct. 10, 2012, in New York. The Orioles catcher is Matt Wieters and the umpire is Brian Gorman.

  • Adam Jones

    Baltimore Orioles' Adam Jones hits a single during the fourth inning of Game 3 of the Orioles' American League division baseball series against the New York Yankees on Wednesday, Oct. 10, 2012, in New York.

  • Mark Reynolds

    Baltimore Orioles' Mark Reynolds reacts after being hit by a New York Yankees pitch during the fourth inning of Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Hiroki Kuroda

    New York Yankees starting pitcher Hiroki Kuroda looks away as Baltimore Orioles' Manny Machado runs the bases after hitting a home run during the fifth inning of Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Alex Rodriguez

    New York Yankees' Alex Rodriguez reacts after striking out during the fourth inning of Game 3 of the American League division baseball series, as Baltimore Orioles catcher Matt Wieters throws the ball back to the pitcher Wednesday, Oct. 10, 2012, in New York.

  • Hiroki Kuroda

    New York Yankees' Hiroki Kuroda rubs up a new ball as Baltimore Orioles' Manny Machado runs the bases after hitting a home run during the fifth inning of Game 3 of the American League division baseball series Wednesday, Oct. 10, 2012, in New York.

  • Alex Rodriguez

    New York Yankees' Alex Rodriguez walks away after striking out during the sixth inning of Game 3 of the Yankees' American League division baseball series against the Baltimore Orioles, Wednesday, Oct. 10, 2012, in New York. At left is Baltimore catcher Matt Wieters.