ST. PETERSBURG, Florida — Alex Cobb had spectacular defense behind him — on one play, his own glove, literally, behind him — and held the Boston Red Sox to two hits as the Tampa Bay Rays held on for a 1-0 win on Saturday afternoon at Tropicana Field.

“What the defense was able to do behind me — Hechy (shortstop Adeiny Hechavarria) was making two of the top 10 plays of the night for (ESPN’s) SportsCenter,” Cobb said.

Cobb (7-6) pitched a gem, giving up only two singles while striking out three to outduel defending Cy Young Award winner Rick Porcello. Tampa Bay (46-43) is assured of a winning record at the All-Star break while Boston (50-38) lost to its division rival for the second time in three days, with the series finale coming Sunday.

Rays closer Alex Colome came in for the final four outs for his 24th save, matching Minnesota’s Brandon Kintzler for the American League lead. Colome gave up a walk and a double in the ninth — the first time the Red Sox had runners in scoring position — but got out of the jam, first by striking out Hanley Ramirez. After an intentional walk to load the bases, Colome got Chris Young to pop out to shallow left-center field to end the game with the tying run at third.

Cobb held the Red Sox to two hits in 7 2/3 innings — Xander Bogaerts had an infield single in the first inning, and Mookie Betts had a single up the middle in the third. From there, Cobb retired 11 batters in a row until Mitch Moreland reached on an error in the seventh. He fielded a comebacker behind his back, getting a key out to help his own cause.

“I think his determination has been the most impressive,” manager Kevin Cash said of Cobb’s recovery from 2015 Tommy John surgery. “You find out a lot about a guy when they’re coming through an injury and how they handle that. He was determined he was going to get it right.”

After giving up runs in five straight appearances entering this series, Colome earned saves in both wins by Tampa Bay.

Cobb had his second dominant outing in three starts — he had eight shutout innings on June 27 in what ended up a 10-inning win over the Pittsburgh Pirates, but he had allowed six earned runs in his last start before bouncing back nicely.

Porcello (4-11) nearly matched Cobb, holding Tampa Bay to one run in eight innings. The Rays scrapped together their only run in the second — Steven Souza and Brad Miller singled to start off the inning and Shane Peterson was hit by a pitch to load the bases. Jesus Sucre’s sacrifice fly made it 1-0, but Porcello got Mallex Smith to strike out to end the inning.

“Hats off to Alex Cobb. He threw an incredible ballgame,” Porcello said. “When their guy is throwing that well, runs are at a premium. It was a tough one, but we’ll get back at it tomorrow.”

The Red Sox dropped to 2-22 this season when scoring less than three runs — they’ve been shut out seven times in 2017. The Rays got just their second shutout of the season, following a May 25 game against the Los Angeles Angels.

“It was a great game from both sides,” Boston’s Mookie Betts said. “You can’t ask for a better pitcher’s duel than that.”

The two teams split the first two games of the series with lopsided wins.

NOTES: Red Sox SS Xander Bogaerts was back in the lineup after missing Friday’s game. He had left Thursday’s game in the first inning after being hit in the right hand with a pitch. He had an infield single in the first inning. … The game drew 23,419 fans — the third straight strong crowd at Tropicana Field — with fans getting an Evan Longoria “Game of Thrones” bobblehead. … Sunday’s series finale is a pitcher’s showdown between Rays RHP Chris Archer, named as a late addition to the All-Star Game, and former Tampa Bay LHP David Price, who remains close friends with his ex-teammate.