Raul Ibanez slammed two game-changing home runs — one to tie the game in the bottom of the ninth — and another to win it in the 12th as the Yankees take a 2-1 series lead over the upstart Orioles. (Alex Trautwig/Getty Images)

At his Wednesday news conference before Game 3 of this American League Division Series, New York Yankees Manager Joe Girardi fielded more questions about leaving Alex Rodriguez in the lineup than he did about any other topic. Girardi was steadfast in his commitment to the slumping veteran and to keeping his lineup intact.

But by the time the bottom of the ninth inning rolled around, Rodriguez was hitless in three more at-bats, the sellout home crowd of 50,497 was booing him and the Yankees trailed the Baltimore Orioles, 2-1.

So Girardi did what just hours before might have felt unthinkable. He pinch-hit for Rodriguez with Raul Ibanez, who homered off right-hander Jim Johnson with one out in the ninth to force extra innings. Then in even more stunning fashion, Ibanez homered again in the 12th, off lefty Brian Matusz, to lift his team to a 3-2 victory and a series lead of two games to one.

The Orioles, unexpectedly in the playoffs for the first time in 15 years, are one game from elimination thanks to Girardi’s hunch, the team’s second bullpen failure of the series and Ibanez becoming the first player in major league history to hit two home runs in a postseason game with both coming in the ninth inning or later.

“One pitch,” said Orioles Manager Buck Showalter, whose team had won 16 consecutive extra-inning games. “That’s the world we live in. Got to tip your hat to the other guy every once in a while.”

Ibanez was initially confused about why he would be called on to bat for Rodriguez.

“For a minute I just thought something was going on,” he said. “I didn’t know what was happening, and then I just tried to put it behind me and get a good pitch to hit.”

“That part caught me off guard,” Orioles center fielder Adam Jones said of Rodriguez being replaced in the ninth inning of a one-run game. “Pinch-hitting for a guy who’s half a billionaire. Hey, I guess they pushed the right button today.”

Said Girardi: “You have to make some decisions sometimes that are tough decisions. But I just had a gut feeling. You’ve got a left-handed hitter who’s a low-ball hitter [and] in a sense you’ve got a low-ball pitcher.”

Baltimore squandered a stellar starting effort from rookie right-hander Miguel Gonzalez, who gave up five hits and one run in seven innings. He struck out eight, including four of the last five batters he faced.

As a spectator in the bottom of the 12th, however, he had no command of the game he had controlled.

“It breaks your heart,” Gonzalez said in a barely audible tone in the Orioles’ clubhouse. “I’m just out of words right now. It was a tough game for us tonight, but I know we’re going to come out tomorrow and play a better game.”

The Orioles got a runner on base in two of the three extra innings. In the top of the 10th, Robert Andino led off with a single and moved to second on Manny Machado’s sacrifice bunt. But Nate McLouth’s sharp liner went straight to shortstop Jayson Nix, who stepped on second to complete a double play. With two outs in the top of the 12th, Mark Reynolds reached when a pop fly fell between first baseman Mark Teixeira and reliever David Robertson. Andino grounded out to the pitcher to end the inning.

Gonzalez, who in three starts in Yankee Stadium has struck out 25 batters, walked one and given up five runs in 20 2/3 innings, was not the only rookie standout for Baltimore. Ryan Flaherty and Machado became the first pair of rookie teammates to homer in the same postseason game in major league history.

Baltimore right-hander Darren O’Day threw a scoreless eighth to preserve a 2-1 lead before Johnson entered in the ninth and gave up the game-tying home run. Johnson allowed five runs in the ninth inning of a 7-2 loss to the Yankees in Game 1.

“I feel like it’s just location,” Johnson said. “I feel the same as I’ve felt for 162 games before that. It’s just one of those things that just happens. Everything that happens gets magnified in the playoffs.”

“I just missed my location,” Matusz said. “And [Ibanez] made it hurt.”

Yankees starter Hiroki Kuroda gave up only five hits, incuding the two homers, in 8 1/3 innings, with three strikeouts and one walk. New York shortstop Derek Jeter left the game with a bone bruise on his foot. His status is questionable for Game 4.

On Thursday, Baltimore will start left-hander Joe Saunders (3-3, 3.63). The West Springfield High graduate was the winning pitcher in the wild-card game at Texas that nudged the Orioles into the division series. The Yankees will start right-hander Phil Hughes (16-13, 4.23 ERA).

“We’re going to have the same attitude, the same mentality we’ve had since the first day of spring training,” Jones said. “Come out here to have fun, let it fly, and live with the results.”