Updated

With each inning that rolled by Tuesday night, the Seattle Mariners' odds of winning kept falling.

That's because they were playing the Baltimore Orioles: a team deep in playoff intensity, a team that had beaten the Mariners six straight times, a team that had won 13 straight extra-inning games — including going 8-0 on the road.

Both of those streaks were extended.

Taylor Teagarden stroked a pinch-hit RBI single to right in the 18th inning to help give the Orioles a 4-2 comeback victory over the Mariners. The Orioles' 14-game extra-inning winning streak is the longest since the 1949 Cleveland Indians won 19 straight.

The win allowed the Orioles (84-64) to pull within a percentage point of the Yankees (83-63) for the lead in the AL East. The Yankees were rained out Tuesday and will play a split double-header with Toronto on Wednesday.

Baltimore maintained a three-game lead in the wild-card race over the Los Angeles Angels, who beat Texas 11-3 in Anaheim.

"It's tough," said Nate McLouth, who had three hits. "When you start going that long, there's a part of you that has to fight the feeling, 'Oh, let's just get this game over with.' Especially in the position we're in. It's a really important game. It's hard to stay locked in that long."

Mariners manager Eric Wedge said to essentially play a continuous double-header "is a challenge. It's a scenario you don't get into too much, but every now and then it happens. It's tough on both sides offensively. Everyone wants it so bad. We had so many opportunities. One more hit and the game's over.

"It wasn't that we weren't creating opportunities. A couple bunts we didn't get down hurt us. But we still had opportunities on top of that, just nobody stepped up offensively."

McLouth opened the 18th with a walk off Lucas Luetge (2-2). With McLouth breaking toward second, J.J. Hardy sent a single through the right-side hole. McLouth continued onto third.

McLouth said it wasn't a hit-and-run.

"I felt like I could get the bag. He had a strike on him so he swung," he said. "It happened to go in a good spot."

Teagarden then lifted his game-winner down the right-field line. Hardy later scored on Mark Reynolds' fielder's choice.

Tommy Hunter (5-8) picked up the victory. And he did it with a little extra measure of "good luck." Just before taking the mound in the 16th, one of the hovering seagulls unloaded on his hat.

"Here I was minding my own business," Hunter said. "Guys were dying laughing. Then everyone said it was good luck. Then we won the game."

Jim Johnson worked the 18th to pick up his 44th save — most in the majors — in 47 opportunities.

"That dugout was alive the whole time, the whole extra innings," Orioles manager Buck Showalter said.

The Orioles rallied in the ninth off starter Erasmo Ramirez, who had allowed just two hits and was sitting on a 2-0 lead. Pinch-hitter Ryan Flaherty and McLouth opened with singles to bring in closer Tom Wilhelmsen.

Hardy dropped a sacrifice bunt to advance the runners. Chris Davis followed with a two-run single to right.

"It tried to be aggressive with the hitters in the ninth," Ramirez said, "just tried to get ahead in the count."

Wedge said Ramirez "was fantastic. He threw a great ballgame. You look back to the previous two starts before he got hurt and the last two. That is what you want to see, that is what you love to see."

Wei-Yin Chen went 5 1-3 innings, allowing two runs on six hits. He walked two and struck out two.

It was the longest extra-inning game for the Mariners this season. They are 5-8 in extra innings.

Justin Smoak and Dustin Ackley each had three hits for the Mariners.

It appeared that Chen would breeze through the fourth after the first two batters bounced out to the infield. Casper Wells then drew a walk on a 3-2 pitch. Miguel Olivo followed with his 11th home run on a 1-2 curve from Chen, who had started him with four straight fastballs.

Ramirez retired the first nine batters before McLouth's leadoff single in the fourth, just tipping off the glove of second baseman Ackley. He then retired the next eight straight before McLouth's double to center in the sixth. Center-fielder Franklin Gutierrez caught the ball on a dive but it popped out of his glove on contact with the ground.

Ramirez, recalled from the minors on Sept. 1, matched his career high with eight innings. He allowed four hits and both runs were charged to him. He struck out six and walked no one.

Olivo caught the entire 18 innings.

"This is the first game I catch two games in one," he said.

Wedge said of Olivo, "Miguel is as tough as they come and his drive, his heart and his intensity are second to none. ... you feel for all your guys, but your guy is back there catching 18 innings and fighting through it all."

NOTES: DH Jim Thome (neck) and LHP Troy Patton (ankle) are finishing rehab assignments at the Orioles' Sarasota facility and could rejoin the club this weekend in Boston. "They're both close," manager Buck Showalter said. "We'll make the call (Thursday)." ... RH Miguel Gonzalez and RH Chris Tillman will start in Boston with the third starter to be decided. ... Chen is just the fourth Orioles rookie pitcher since 1954 to make at least 30 starts. He joins Bob Milacki (36 in 1989), Tom Phoebus (33 in 1967) and Brian Matusz (32 in 2010). ... Felix Hernandez was recognized before the game as the Mariners' nominee for the Roberto Clemente Award. "That's a great honor," manager Eric Wedge said. "Felix is the total package. To see what he does off the field, how he carries himself, how generous he is with his time, with people, it's well-deserved." ... RHP Hector Noesi, shelled for six runs and eight hits in 1 1-3 innings Monday, is back in the bullpen for the rest of the season. RH Blake Beavan will fill his spot in the rotation, starting Saturday. ... Michael Saunders was ejected in the 10th inning for disputing a called third strike.