The man who heard it worst of all from the crowd throughout the night was the first person on the dugout's top step to greet the man who replaced him.

Raul Ibañez, pinch hitting for Alex Rodriguez, slammed a game-tying home run with one out in the ninth off Orioles closer Jim Johnson when it appeared the Yankees were about to lose Game 3 of the best-of-five AL Division Series.

It was hard to see who was first to get to the 40-year-old in the 12th.

Pure bedlam reigned then.

Ibañez, three innings after sending the game into extra innings, hit a leadoff homer off Brian Matusz to give the Yankees a thrilling 3-2 victory over the Orioles Wednesday night and a 2-1 lead in the series.

"I'm going to watch the highlights to make sure it actually happened,'' Mark Teixeira said. "I can't believe that just happened.''

Ibañez crushed a 1-and-0 pitch from Johnson, whom the Yankees torched for five runs in a Game 1 victory, into the seats in right-center in the ninth, tying it at 2 and sending the Stadium crowd of 50,497 and Yankees dugout into a high-fiving, fist-bumping frenzy.

Subscribe to Newsday’s sports newsletter

Receive stories, photos and videos about your favorite New York teams plus national sports news and events.

"I saw the ball exit his bat and I turned to the dugout and everybody instantly turned into a 12-year-old,'' Nick Swisher said. "We were just so excited. This stadium was electric.''

Mariano Rivera, who threw out the ceremonial first pitch, said he predicted -- to A-Rod -- Ibañez's pinch-hit shot in the ninth.

"Thank God we have Raul on our side,'' Rivera said.

While fans rode A-Rod -- 0-for-3 with two strikeouts heading into the ninth -- hard all night, Joe Girardi's decision to pinch hit for an all-time offensive talent couldn't be chalked up as a no-brainer. Not given the player involved; not given the reverberations that still linger six years after Joe Torre famously dropped Rodriguez to eighth in the order in Game 4 of the 2006 ALDS.

"It couldn't happen to a better guy, Raul has just been phenomenal,'' Rodriguez said. "I love Joe [Girardi]. I'm one of the leaders of the team. Maybe 10 years ago I react a different way.''

Girardi said he liked the matchup of Ibañez, a good low-ball hitter, against Johnson's sinkerball.

"I just felt I had to do what was in my gut, what my stomach was telling me and what I thought was the best thing to do,'' Girardi said.

The reaction in the other dugout to A-Rod getting removed? "That part caught me off guard,'' Orioles centerfielder Adam Jones said. "Pinch hitting for a guy who's half a billionaire.''

Rodriguez, 1-for-12 with seven strikeouts in the series, stood at the entrance of the dugout to embrace the 40-year-old Ibañez after the game-tying shot. The Orioles were 74-0 during the regular season when holding the lead after seven innings and at one point this season had won 16 straight extra-inning games.

Ibañez, who became the first player in MLB history to hit two homers in a postseason game with both coming in the ninth inning or later, had his share of big late-inning hits. Among them: a two-run homer that tied it in the 13th against Oakland Sept. 22, an eventual 10-9 victory in 14 innings; and a game-tying, two-run homer in the ninth Oct. 2 against Boston, a 4-3 win in 12 innings.

"It's been a blur,'' Ibañez said of the past three weeks, which included the birth of a son last Wednesday. "You definitely try and draw on past experiences, past successes, and you try to have a short memory about past failures, too.''

The Yankees got standout pitching all night, starting with Hiroki Kuroda, who allowed two runs -- coming on a pair of solo home runs by Ryan Flaherty and Manny Machado -- and five hits in 81/3 innings.

He gave way to Boone Logan, Rafael Soriano and David Robertson, all of whom did their jobs with scoreless outings.

"It's hard for me to think,'' Swisher said, "of a more exciting game.''