BALTIMORE -- The first doubleheader sweep in the history of the Tampa Bay franchise moved the Rays two steps closer to a far more important milestone: their first AL East crown.
Tampa Ray reduced its magic number to win the division title to two Tuesday night, scoring six runs in the eighth inning to rally past the Baltimore Orioles 7-5 for an unprecedented sweep.
James Shields pitched seven effective innings to lead the Rays to a 5-2 victory in the opener.
The sweep, combined with Boston's 5-4 win over the Cleveland Indians, left the Rays three games ahead of the Red Sox in the AL East. Any combination of Rays wins and Boston losses totaling two will give Tampa Bay its first division title.
"We can taste it a little more tonight," reliever J.P. Howell said. "We need a little help from Boston, but we can't rely on them. Let's just keep this thing moving.
"And just because if we win this division doesn't mean we can stop. We have to go all the way to Oct. 30 in my book."
In the nightcap, Tampa Bay trailed 5-1 before Evan Longoria homered and pinch hitter Dioner Navarro singled in two runs off Jamie Walker (1-3) in a six-run eighth inning. The Rays had five hits through the first seven innings and six in the eighth, including a triple by Ben Zobrist and an RBI single by pinch hitter Jason Bartlett.
"That was quite a comeback right there," manager Joe Maddon said. "The whole team contributed."
Jeff Neimann (1-2) pitched 2 1/3 innings and Howell got five outs for his third save.
The victory enabled the Rays (95-62) to break the record held by the 1991 Atlanta Braves for most wins by a team that owned the worst record in the majors one year earlier.
Baltimore has lost eight straight and 27 of 33. The Orioles have also dropped 11 in a row to Tampa Bay and are 3-14 overall against the Rays.
In the second game, Maddon did not start regulars Bartlett, Carlos Pena, B.J. Upton, Navarro and Akinori Iwamura. Mitch Talbot made his first major league start. He gave up three runs and six hits in 4 1/3 innings.
And the Rays still got their first-ever doubleheader sweep.
"Really?" Maddon said.
"If we're going to be here as long as we've been here," Cliff Floyd said afterward, "we sure better sweep."
It was the 14th doubleheader in Tampa Bay history; the Rays had split seven and been swept six times.
Baltimore's Alfredo Simon, who was also making his first start in the majors, allowed three runs in 7 2/3 innings. But his effort was ruined by Walker, who allowed four runs in the eighth and failed to get an out.
"I wish I could change it, but obviously I can't," Walker said. "So I've got to live with that. That's baseball. I've got to forget about it when I walk out that door, but that's a game we should've won and it's a hard one to swallow."
Orioles manager Dave Trembley wanted to bring in Jim Miller, but the reliever felt a pain in his side while warming up and took a seat in the bullpen.
"So we had to get Walker going," Trembley said.
In the first game, Shields (14-8) tied the club record for wins, set in 1998 by Rolando Arrojo. The right-hander gave up eight hits, struck out eight and walked one in his career-high 32nd start of the season.
Rookie Fernando Perez went 3-for-3 with two RBIs, and Bartlett also had three hits for the Rays.
After Montanez gave Baltimore a 2-0 lead in the second inning, the Rays pulled even in the fifth. Navarro hit a leadoff double and Bartlett singled before Olson threw wildly to first on a pickoff move, allowing Navarro to score. Perez followed with an RBI double.
"I think that was definitely a big turning point in the game," Olson said of his errant toss. "I felt like after that happened, lose that lead, pretty soon it's a tie ballgame."
Tampa Bay took the lead in the sixth when Navarro singled and scored on a double by Bartlett, and Pena got his 101st RBI with a two-out single off Lance Cormier in the seventh.
In the eighth, Perez got credit for an RBI single when his attempted squeeze bunt popped out of the glove of pitcher Alberto Castillo, who attempted to make a diving grab.
The Rays announced that they have sold out the first two home games of the AL division series. Tampa Bay ranks 12th among 14 AL teams in home attendance, averaging 22,370. ... Baltimore's Omir Santos got his first major league hit in the opener, but was thrown out trying to stretch it into a double. ... Talbot was the ninth different starter used by Tampa Bay this season, all of them under 26 years old.