ST. PETERSBURG -- Finally, the Rays have created some adversity for the Red Sox in the American League Division Series.

Jose Lobaton ended a tense and long-winding contest by belting a two-out walk-off homer to right-center in the bottom of the ninth against Koji Uehara, who has been dominant all season for the Red Sox.

That gave the Rays a 5-4 win to slice the Red Sox's lead to 2-1 in this best-of-five series.

It was a swift momentum change, considering that the Red Sox, down by a run entering the top of the ninth, came back and tied it.

Will Middlebrooks started the tying rally in the ninth with a walk against closer Fernando Rodney. Jacoby Ellsbury blooped one over third base and into short left field for a single, his third hit of the night.

Shane Victorino dropped down a good bunt, moving the runners to second and third with one out.

Dustin Pedroia did what he needed to do, hitting a grounder to deep short that got the tying run home.

After dominating the action at Fenway Park in the first two games, Boston had a much tougher go of it under the roof of Tropicana Field.

Clay Buchholz had a 3-0 lead, but he lost it on one pitch when Evan Longoria belted a towering three-run shot in the bottom of the fifth.

If not for the rocket by Longoria, Buchholz would have been lauded for a gritty effort in which he made several big pitches with men on base. The righty had to work hard in his six innings of work, giving up seven hits and three runs. Buchholz walked three, struck out five and threw 104 pitches.

There were some brief scares for Buchholz. Jose Molina hit one down the line in left that had the distance to be a home run, but it was just foul. Wil Myers did the same thing in the fourth, going to the opposite field in right, only having it curl foul.

In that fourth, Buchholz walked two, helping the Rays load the bases. But he made a nasty 0-2 changeup that caught Joyce looking to end the threat.