Raul Ibanez simply wouldn't give up. That can be the only explanation for what happened on Tuesday night for the New York Yankees.

Down 3-1 in the bottom of the ninth inning, with the Orioles having already won, with only one game left in the season, with the chance of having to play an extra game in Baltimore if they lost, Ibanez stepped up as a pinch hitter and erased all of it.

He hit a two-run home run to tie the game and then added another exclamation point, hitting the game-winning RBI single in the 12th to beat the Red Sox 4-3 to maintain New York's one-game lead in the AL East.

"We stuck together. We stayed after them, and we were able to pull it out," Ibanez said to the Associated Press. "It's crunch time for us, and we all know that."

The Yankees now put themselves in a prime position to take the division. If they win, they are the AL East Champions. If the Orioles lose, they are AL East champions. If the two teams end up with the same record at the end of the year, they will play a 163rd game in Baltimore to decide the division. The losing team would then play the one-game, wild-card playoff.

"If you win, you win the division. That's the bottom line," manager Joe Girardi said. "And we have the chance to have the best record, and that's the bottom line and that's a good feeling that you can control that."

The Yankees bucked a trend on Tuesday night that had been dogging them all year. According to ESPN.com, New York has a 0-58 record this season when trailing after eight innings. Ibanez helped them finally add a one to the win column.

After James Loney hit a solo home run in the top of the ninth inning, Curtis Granderson led off the bottom of the inning with a single off of Red Sox closer Andrew Bailey. Ibanez stepped up next as a pinch hitter and tied the game with one swing.

Rafael Soriano pitched the ninth and tenth innings before Derek Lowe came in. He pitched two innings and earned the win by keeping the Red Sox at bay so the Yankees could have a chance in the 12th. Ibanez stepped up to the plate against reliever Andrew Miller with catcher Francisco Cervelli on base and smacked a single into left field to bring home the winning run.

It's not the first time this season that Ibanez has hit a two-run home run in a tight spot to tie a game. On Sept. 22 he hit one in the 13th inning that tied a game against Oakland that the Yankees eventually won. Amazingly, 10 of Ibanez's 19 home runs have tied games or given the Yankees a lead, according to ESPN.com.

"I must've thanked Ibanez 100 times," said Mark Teixeira, who was 0-for-4 with runners in scoring position. "Raul is my favorite player right now. I guarantee I'm the happiest guy on the team because it could not have gone worse for me personally, but we won."

According to ESPN.com, the loss dropped the Red Sox to 69-92 and clinched a last place division finish for the first time since 1992.

"We didn't start the season to finish fifth ... or fourth or third or second," manager Bobby Valentine said.

Soriano threw 43 pitches on Tuesday night, the most since Sept. 2005 according to ESPN.

"Hopefully, he feels OK tomorrow if I need him," manager Joe Girardi said. "I've said it all along and I'll say it again: trying to win the division."

The Red Sox took and early 2-0 lead after a Dustin Pedroia double and a Cody Ross sacrifice fly in the first inning. The Yankees added a run on Eduardo Nunez's infield single, but wouldn't score again until the magical ninth inning. The team dumped cold water on Ibanez following his big single in the extra frames.

"It was really cold. My back was numb for a while," Ibanez said, "but it felt good."

The Yankees also are in line for a chance to have the best record in the American League, which would give them home field throughout the playoffs. Texas lost to Oakland on Tuesday night, leaving the two tied atop the AL West with only one game left to play.

The loss dropped Texas to 93-68, leaving the Yankees one game better. If the Yankees win on Wednesday, they will clinch the best record in the American League.