The A's had not won a road series in three months, so it was natural that a victory Sunday required some struggle.

After Grant Balfour surrendered a tying home run to Evan Longoria in the seventh inning, Josh Willingham delivered the go-ahead homer in the top of the 10th that lifted the A's to a 5-4 victory over the Tampa Bay Rays at Tropicana Field.

The A's took the final two of the three-game set, capturing their first road series since they won two of three at Kansas City on May 6-8.

They hadn't even won consecutive road games since May 8-9, when they beat the Royals and then won a series opener against the Texas Rangers.

"We haven't done that in a while," closer Andrew Bailey said of winning a road series. "Looking back at this year, it's kind of been the story -- close games where we've fallen short."

Indeed, the A's have lost more games like Sunday's contest than they have won. They began the day an American League-worst 14-20 in one-run games, and they were 6-10 in extra-inning affairs, second worst in the league.

"We needed, for many reasons, an outcome like this today," A's manager Bob Melvin said. "A win against a good team, one-run (margin), extra innings ... all of those things."

Bailey, who had gone 11 games without pitching in a save situation, provided tension in the bottom of the 10th when he put two runners aboard with one out.

B.J. Upton popped up for the second out, and Matt Joyce lined an 0-2 fastball up the middle. But shortstop Eric Sogard was positioned perfectly, moving just a couple of steps to his left to snare it for the final out.