Andrew Benintendi came up with the bases loaded and the Chicago White Sox down four runs in the bottom of the seventh during Game 2 of Thursday’s doubleheader against the St. Louis Cardinals.

His mind was on getting a pitch to hit hard.

“I was just looking for something elevated in the zone,” Benintendi said. “(Cardinals reliever Kyle Leahy) hung a slider.”

The result: a game-tying grand slam.

Benintendi’s blast capped a five-run rally. The Sox had chances in the eighth and ninth to pull ahead but came up empty. The game went to extra innings, and the Cardinals scored twice in the 10th and held on to defeat the Sox 8-6 in front of 20,816 at Rate Field.

The Sox were swept in the doubleheader and have lost eight straight — matching a season high. They lost by a combined three runs Thursday after suffering a 5-4 defeat in Game 1.

“We keep putting ourselves in positions to win,” Benintendi said. “Just keep working on it, I guess. Really just trying to keep going, putting ourselves in that position and at some point it will turn.”

The Sox entered the seventh inning of Game 2 trailing 6-1. Mike Tauchman drove in a run with a two-out single.

Chase Meidroth walked, loading the base for Benintendi. He connected on the first pitch, driving the ball over the right-field wall.

“We’ve seen it time and time again from this group where they continue to fight,” manager Will Venable said. “I thought that between the bullpen holding those guys right there and those quality at-bats leading up to the (Benintendi) grand slam, which obviously was a big knock, just a great job on a tough day for our guys to continue to fight.

“That’s just what we’ve seen from them this whole year and what we expect.”

The Cardinals threatened in the eighth with runners on second and third and one out. Jose Barrero missed on a bunt and catcher Edgar Quero threw Nolan Gorman out as he tried to make his way back to third.

The Sox had runners on the corners with one out in the bottom of the eighth. Austin Slater hit a screamer, but the shortstop Barrero made a diving catch. Luis Robert Jr. then popped out to end the inning.

Tauchman was on third with one out in the ninth. Vinny Capra hit a chopper to third and Nolan Arenado threw home, where Tauchman was tagged out. Tauchman had slowed up on his way to the plate and exited with right groin soreness. Venable said the right fielder is day to day.

The game went to the 10th, where Arenado drove in the go-ahead run with a single. He was out trying to take second, but Lars Nootbaar followed with a home run to make it 8-6, and the Cardinals were on their way to completing the doubleheader sweep.

The Cardinals pulled off the late rally in Game 1.

The Sox took a 4-2 lead on a two-run home run by Michael A. Taylor in the sixth. But the Cardinals responded with three runs in the eighth.

The Cardinals tied with a two-run home run from Willson Contreras against reliever Cam Booser.

Gorman then hit a grounder back to the mound, and Booser threw wildly to first. Gorman advanced to second on a wild pitch and third on a flyout. Pozo drove him in with a single.

The Sox were retired in order in the eighth and ninth, dropping to 4-20 in one-run games.

“I don’t think we’re far off in these games,” Sox Game 1 starter Sean Burke said of the close losses. “I don’t think it’s any one part that you kind of point out and say, ‘This is the reason why we’re losing these games.’ There’s a bunch of things we can do better as a team top to bottom. A game like that, if I have a better start from the beginning, maybe I’m able to go a full six with no runs. Or that last inning, maybe one or two things go differently, I’m able to finish that inning. Hitting-wise, if you get another hit.

“I don’t think it’s ever one aspect of a team. Just overall we have to be a little better in those games, and I think now that we’ve been in a lot of one-run games, close games, the experience with that will help us do better with it in the future.”

The Sox were in another tight game in Game 2 but suffered another loss to fall 29 games under .500 at 23-52.

“Every time we hit a tough spot, they flush it and take what they can from it to make them better for next time and just continue to fight,” Venable said. “That’s what we did today all day and that’s what we’ll continue to do tomorrow.”