BOSTON — Fighting tooth and nail to be a .500 team, the last thing the White Sox can afford is to lose their shortstop.

But that’s what they’re facing with the news that Tim Anderson, who’s having a breakout year worthy of All-Star consideration, likely will be out for an extended time, probably weeks, with a high ankle sprain.

An improbable 8-7 victory on Jose Abreu’s two-run homer in the ninth inning against right-hander Matt Barnes softened the blow.

The Sox (37-41) salvaged the last game of the three-game series at Fenway Park after closer Alex Colome had blown a save during the Red Sox’ three-run eighth. They had lost four in a row and needed the victory to finish 2-4 on a road trip through Texas and Boston.

But Anderson’s injury is going to leave a mark.

“It’s just part of the story,” Anderson said. “Just have to keep working.

“It’s part of my life, man. You go through things, and you learn things. Just another thing I have to go through, and I’ll be back.”

When will that be? Anderson, who had an MRI exam on Wednesday morning, couldn’t hazard a guess.

“We’ll get the images, evaluate those and everything will be announced Friday in terms of where he’s at,” manager Rick Renteria said. “I don’t have a timetable.”

While Abreu called on Major League Baseball to prevent games from being played in unsafe conditions, the Sox have played on wetter fields than they did Tuesday, and Anderson didn’t think the surface was a factor when he ranged to his left and injured his right ankle while making a throw to Abreu at first.

“I just planted wrong,” Anderson said. “It could have happened on a dry field.”

Anderson “kind of felt a little pop and was scared a little bit, but we’re still waiting to see what it is. I’m just glad to be moving around.”

But not without a noticeable limp. And he’s leaving a hole in the lineup that will certainly be notable.

“He’s one of our best players,” Abreu said.

Abreu fouled off six pitches in a 10-pitch at-bat before sending the last one over the Green Monster and all the way out of the park for his 19th homer, scoring Yolmer Sanchez. Colome did his job in the ninth, and the Sox won a game started by Chris Sale, who allowed five runs in six innings.

“We battled,” said Abreu, who drove in four runs. “When we surrendered the lead, we didn’t get down. Just kept grinding.”

The Sox also had to grind through the loss of third baseman Yoan Moncada and sickness that is making the rounds through the clubhouse. Sale hit Moncada above the right knee with an 81 mph slider in the first inning, and after he ran to third on Abreu’s 200th career double, he left the game.

Sanchez, who missed the Sox’ 6-3 loss Tuesday with 103-degree fever, pinch-ran for Moncada and played the rest of the game at second base with Jose Rondon moving to third. And right fielder Charlie Tilson couldn’t finish the game because of flu-like symptoms. First base coach Daryl Boston wasn’t feeling the best, either.

“If you want to shake anybody’s hand, don’t,” Renteria said.

The Sox blew 3-0, 5-2 and 6-4 leads before the Red Sox scored those three runs in the eighth against Evan Marshall and Colome, taking Sale, who allowed six of the first seven Sox hitters to reach, off the hook.

The official move to the injured list for Anderson probably will be made Friday. The Sox also are expected to call up a pitcher from Class AAA Charlotte to start while Dylan Covey, who made a rehab start there Wednesday, and Manny Banuelos work their way back from sore shoulders.

“Guys will step up and fill in when their number is called,” Anderson said. “We just have to keep going and playing hard and scratch out those wins like we did today.”