ST PETERSBURG, Fla. — A manufactured run in extra innings capped off a resurgent weekend Sunday for the Boston Red Sox.

Christian Vazquez hit a sacrifice fly in the 11th inning and the Red Sox completed an uplifting three-game sweep of the AL East-leading Tampa Bay Rays with a 4-3 victory.

“That was a big three wins,” said Boston starter David Price, who struck out 10 over five innings. “We know the type of team we have in this clubhouse and I think we showed that these last three days.”

Rafael Devers singled off Jose Alvarado (0-2) to start the 11th and went to second when Michael Chavis walked.

Both runners moved up a base on Jackie Bradley’s sacrifice and Vazquez followed with his fly that Kevin Kiermaier ran down in center field.

“A really good pitcher on the mound, Alvarado, so runs are at a premium,” Bradley said. “You want to do everything you possibly can to make it tough on him, difficult on him.”

Marcus Walden (3-0) allowed an infield hit over two scoreless innings and Ryan Brasier worked the 11th to get his sixth save.

After starting the season by losing 8 of 10, the Red Sox are 7-5 over the last 12 games and went from eight to five games behind the Rays.

“Played good baseball,” Boston Manager Alex Cora said. “We’ve got to keep getting better, that’s what we’ve got to do.”

Tampa Bay has dropped four straight with the bullpen anchors, Alvarado and Diego Castillo, each losing twice.

“We got knocked down,” Rays Manager Kevin Cash said. “We’re capable of getting back up. We were in every ballgame, which ultimately is not good enough. We’ve got to get back to finding ways to win games.”

Tommy Pham, picked off first base by catcher Vazquez to end Saturday night’s 6-5 loss to the Red Sox, got the Rays even at 3-3 on his eighth-inning solo homer off Matt Barnes.

Boston went ahead 3-2 on Xander Bogaerts’ two-run single off Chaz Roe during the sixth.

Rays starter Tyler Glasnow, bidding to open the season with five consecutive wins, was pulled after Mookie Betts singled with one out in the sixth.

After Adam Kolarek walked the only batter he faced, Roe entered and walked J.D. Martinez before Bogaerts lined a first-pitch single to right-center.

Glasnow, who entered with an AL-best 1.13 ERA, allowed two runs and three hits in 5 1/3 innings. He was frustrated by the decision to take him out after a season-low 76 pitches.

“It doesn’t matter if I agree or disagree with it, that’s how the Rays do it,” Glasnow said.

Daniel Robertson put the Rays up 2-0 on a two-out, two-run double off Price in the third. It was just his third hit in 28 at-bats.

Price, the one-time Tampa Bay ace, gave up two runs, five hits and walked two during a 100-pitch outing.

Boston pulled within 2-1 on Mitch Moreland’s team-leading seventh homer in the fourth.

TRAINER’S ROOM

RED SOX: Moreland was in the lineup after leaving Saturday’s game with back spasms.

RAYS: Blake Snell (fractured right fourth toe) is expected to have his second bullpen session Tuesday.

MARTINEZ MAGIC

Martinez had an infield single in the first inning, giving him a hit in 21 of 22 games this season, including an active 11-game streak. He joined Eddie Bressoud in 1964 as the only Red Sox players to have a hit in at least 21 of the team’s first 22 games. Martinez also swiped second for his 23rd stolen base in 944 career games.

RARE OCCURANCE

Vazquez’s pickoff Saturday night was the first in a Red Sox victory during the expansion era (1961-present) by a catcher to end a game, according to the Elias Sports Bureau.

UP NEXT

RED SOX: Left-hander Chris Sale (0-4) will face Detroit left-hander Matthew Boyd (1-1) when Boston begins a 10-game homestand Monday night. Sale has allowed 17 runs and 23 hits over 18 innings in his four starts this season.

RAYS: Right-hander Yonny Chirinos (3-0) will go against Kansas City right-hander Brad Keller (2-1) on Monday night. Tampa Bay went 7-0 against the Royals last season.