ST. PETERSBURG, Fla. (AP) — It's taken nearly four months, but the Boston Red Sox are back in second place in the AL East.

Christian Vázquez hit a tiebreaking home run in the seventh inning, Marcus Walden bailed the defending World Series champions out of a bases-loaded jam in the ninth, and the Red Sox held off the Tampa Bay Rays 5-4 on Tuesday night to climb into second for the first time since the second day of the season.

The Red Sox, who have recovered from a 3-8 start, improved to a season-high 10 games over .500 at 56-46, moving one percentage point ahead of the Rays (57-47), who have lost seven of eight.

"It seems like it's been an eternity to get to 10, but we know where we're at now," manager Alex Cora said.

"It seemed early in the season that those guys were way ahead of us," Cora added. "It's something that we learned, that we can catch up with people."

The Red Sox had not been in second place since they were 1-1 after play on March 29, tied with Tampa Bay and Toronto. They are two games behind Oakland for the second AL wild-card berth.

"We've still got some work to do," said pitcher Chris Sale, who has dropped his ERA from 4.24 to 4.00 in his last two starts. "I don't think you exhale yet. You just keep your foot on the gas."

With the score 2-2, Vázquez hit his second career pinch-homer, a drive into the left-field seats off Colin Poche (2-4).

Boston boosted the lead to 5-2 in the eighth when Andrew Benintendi hit an RBI groundout and Jackie Bradley Jr. was hit by a pitch from Adam Kolarek with the bases loaded, forcing in a run.

Ji-Man Choi's had a run-scoring single off Brandon Workman in the ninth. Walden entered with the bases loaded and two outs, walked Tommy Pham on four pitches, then retired Austin Meadows on a game-ending groundout.

Tampa Bay manager Kevin Cash didn't take solace in his team hanging in the game until the final out.

"If you asked me that two weeks ago, I probably would have been more encouraged," Cash said. "We need to win. So, get the big hit, make the big pitch. We're just not doing it right now. So no, there's not too much encouragement right there."

Tampa Bay led the AL East from after play on March 30 through mid-May. After a 14-4 start, they are 43-43 since April 18 and 30-35 against teams currently .500 or better.

"It's one of those things where it seems like every game there's something that's not going our way. ... Baseball can be that way. You go through stretches where things just don't go your way," Poche said. "I think the guys we have on this team, we've got some good leaders and I think we're going to pull out of this."

Boston is a big league-best 32-21 on the road, including 5-0 at Tropicana Field, but 1-5 against Tampa Bay at Fenway Park this season.

Sale (5-9) allowed two runs on Travis d'Arnaud's third-inning homer and limited the Rays to just three other hits while throwing a season-high 116 pitches and striking out 10 over six innings.

Rays starter Yonny Chirinos settled after giving up a pair of two-out runs in the first inning — one on a wild pitch allowing Rafael Devers to score from third base and the other on Benintendi's RBI single.

TRAINER'S ROOM

Red Sox: INF Michael Chavis, out of the lineup for a third straight day after experiencing back spasms, pinch hit in the eighth inning and struck out. He remained in the game at second base. ... 1B Steve Pearce, who has not played since May 31 due to a lower back strain, is swinging a bat in Fort Myers, but the World Series MVP is not close to a return, Cora said.

Rays: Cash said All-Star INF Brandon Lowe, out since July 3 with a right shin bone bruise, was given injection "to get pain out of there" and will be shut down for several days. Lowe, who was wearing a walking boot in the clubhouse on Tuesday, took on-field batting practice Monday. ... INF Yandy Díaz (bruised left foot) was placed on the 10-day injured list, while INF Matt Duffy (strained left hamstring) was reinstated from the 60-day IL. Duffy, who hadn't played in the big leagues this season, started at third base, batted fifth and went 2-for-3 with a walk.

UP NEXT

A prime pitching matchup for Wednesday's series finale features Boston's David Price (7-3, 3.61 ERA) and Tampa Bay's Charlie Morton (11-3, 2.61). Price began his career with the Rays and will make his 17th start against his former team. He's 6-5 with a 3.16 ERA vs. the Rays, including 2-3 with a 2.32 in eight starts and one relief appearance at Tropicana Field.

More From 92.9 The Ticket