ST. PETERSBURG — The Rays looked like they had this one in the bag in the eighth inning. It just took them until the 13th to make it official.
Evan Longoria blasted a two-run homer with two outs in the 13th to give the Rays a 4-2 victory to cap their longest game of the season — just shy of five hours — before the remains of a blue state/red state crowd of 29,873 at Tropicana Field.
"The game was exasperating," manager Joe Maddon said. "Totally exasperating."
The rally started with Michel Hernandez drawing a leadoff walk from Takashi Saito, then moving up on a bunt and a groundout. It ended with Longoria's blast — his second of the night — and the Rays celebrating wildly at home plate after their sixth walkoff win of the season.
"I guess when you hit homers, people don't remember that you struck out four times," said Longoria, who did both. "I'm just happy I got an opportunity to help us win the game. … The celebration might have been a little bit excessive, but I was just happy we won the game and the game was over."
The Rays improved to 59-48, moving them a season-best 11 games over .500 and to within four games of the wild-card leading Sox. It capped a long day in which Maddon restructured the lineup, moving Jason Bartlett to leadoff and dropping B.J. Upton to seventh, and emptied the bench, and they got six shutout innings from the bullpen.
"That was a huge game for us," Longoria said. "A huge win."
The victory also redeemed what had been a ridiculously futile night as the Rays, after rallying from a 2-0 seventh-inning deficit, had the bases loaded with no outs twice — in the eighth and 10th innings — and didn't convert. (Plus they struck out 16 times, left 15 on and went 2-for-14 with runners in scoring position.)
The eighth was a bit complicated as they tied it at 2 on Longoria's leadoff homer, but after loading the bases with no outs on a combination of two walks, a Willy Aybar bunt and a throwing error by reliever Daniel Bard, didn't score any runs.
Well, not that counted, anyway.
The Rays appeared to take the lead when Ben Zobrist came around from first, and added an insurance run when Aybar followed him across the plate and into the dugout, as Bard's throw sailed into the Rays bullpen area.
But the ball got stuck between two equipment bags and the umpires called it a dead ball which, under rule 7.05 (g), makes it like a ground-rule double: two bases for each runner from where they were at the time of the pitch.
Maddon said the bags shouldn't have been, and no longer will be, on the ground. "It's two bases. Period. I had no argument whatsoever. … It's just unfortunate. It's a rule, and it's our fault for having that equipment in play," he said. "It's a once-in-a-lifetime, in-a-million situation. But you can win or lose pennants by one game."
The ruling instead put Zobrist on third and Aybar (actually pinch-runner Joe Dillon) on second, with no outs. Bard walked Carlos Peña, and that still wasn't enough help as Upton and Gabe Gross struck out. Then Pat Burrell — benched temporarily — grounded into a fielder's choice.
Amazingly, the Rays loaded the bases with no outs again two innings later. And, astonishingly, they didn't score then, either.
Dillon, batting for the first time since July 21, singled to lead off the 10th, his first hit since June 6. Peña doubled off the rightfield wall, and Upton walked to load the bases against Ramon Ramirez. But Gross and Hernandez popped out, and Bartlett struck out.
Longoria had a hand in giving the Rays a chance to win, spearing Kevin Youkilis' liner to end the top of the 13th.
He said he was a little surprised the Sox pitched to him, given that there was only a man on third and they could have walked the bases loaded to set up a force at any base with Dillon up, but he didn't want to let those thoughts affect his approach.
"I didn't want to go up there with the mind-set that I was going to give up the at-bat and concede the fact that they were gonna walk me or pitch around me," he said. "I've done that before and then I get out, and I'm walking back to the dugout, going, 'Why did I do that? Why wasn't I ready to hit?' It was in the back of my mind … but I had to prepare myself the best I could to go up there and get a hit."
Boston manager Terry Francona said, essentially, that they preferred Saito have the wiggle room: "We're getting in those situations where at least with the open bases, we can maybe have some room to make some pitches."
He didn't like the idea of facing Zobrist any better, and liked the idea of loading the bases even less, saying it would have been "unfair" to extend Saito to 40 pitches (as they had no relievers left and starter Clay Buchholz warming).
"I wish the ball wouldn't have gone out," Francona said, "but I don't think that would have been the right thing to do."
It took 4:57, but it was worth it.
"If you have to stick around this long," Maddon said, "you might as well win it."
Marc Topkin can be reached at email@example.com