The Rays had been desperately searching for their first walkoff win, a hint of magic that could spark their so-far disappointing season.

And they might have gotten that spark Thursday, Sean Rodriguez circling the bases after his two-out, three-run homer in the 11th lifted Tampa Bay to a 5-2 victory over the A's in front of 11,257 at Tropicana Field. The Rays snapped a four-game losing streak and, they believe, might have changed their fortune.

"It was a seminal moment," manager Joe Maddon said. "We have not had that moment, we've had plenty of opportunities for that moment. I believe there's more of those forthcoming."

"Beautiful," starter Alex Cobb said.

"We needed that," rookie Cole Figueroa said.

The Rays (20-28) had been on track for an easy and — believe it or not — quick win, leading 1-0 entering the ninth inning after Cobb's triumphant return from the disabled list and a seventh-inning rally sparked by Figueroa's first big-league hit. But they appeared headed for another devastating loss after closer Grant Balfour blew a save in the ninth and Josh Lueke gave up the go-ahead run in the 11th.

"I blew the save," Balfour said. "That's the bottom line."

But as the Rays jogged back to the dugout before the bottom of the 11th, their biggest star lit the fire. Evan Longoria has struggled so much recently he quipped that he felt like "I've never played the game before." Longoria was leading off the inning, thanks to Maddon putting him in the No. 2 hole so he'd stop worrying about "driving the whole bus" and just be a "passenger."

Longoria's pep talk in the dugout drove the rally.

"He took off his glove, started clapping," Figueroa said. "He said, 'We got this!' The dugout was a little down, but as soon as he did that, it started to come alive."

Longoria, who was 0-for-4 and in a 22-for-116 skid, battled in an 0-and-2 count against former USF pitcher Dan Otero and ripped a single to left-center.

"That was a big moment," Maddon said.

"As soon as that happened," Figueroa said, "I was like, "We're going to win this game.' "

With one out, Wil Myers— robbed by rightfielder Josh Reddick's leaping catch at the wall in the third — gave the ball another ride. But it was caught on the leftfield warning track.

"I thought he had it," Maddon said.

In six of the Rays' past seven home games, they had the tying run at the plate in their final at-bat, to no avail. Now they were down to their final out. But James Loney singled to put Longoria in scoring position. And scuffling Desmond Jennings — in a 6-for-42 slump, worked the count full after falling behind 0-and-2 to hit an RBI single to center, tying it.