Through all the Yankees’ injuries, Gleyber Torres has remained the most unscathed.

That may have changed at the worst possible time.

Torres left Friday’s 4-3 loss to Toronto in The Bronx after his at-bat in the bottom of the sixth with what he described to manager Aaron Boone as “weakness in his legs” following a strange — and ugly looking — play in the top of the fourth.

That’s when Torres made a sliding stop of a grounder by Vladimir Guerrero Jr. and got up as if to throw to first. His right leg slipped on the outfield grass, however, and he fell to the ground.

Torres appeared to be in considerable pain and stayed on the ground briefly before getting up and being checked out by trainer Steve Donohue and Boone.

“The way he rolled over and the turf gave out little bit on him, that’s a ‘Hold your breath moment,’ ’’ Boone said. “I think he’s gonna be OK.”

Boone said he initially thought he would take Torres out immediately after the play, but the infielder insisted at the time he was fine.

That changed later in the game.

He flied to left in the fourth and struck out in the sixth, which is when he went to Boone and told him his legs were bothering him. He was examined by doctors afterwards and the Yankees expect to know more Saturday.

DJ LeMahieu moved from third base to second and Gio Urshela entered at third.

Torres has been invaluable to the Yankees in his first full season in the majors, with a team-high 38 homers that has helped them survive the loss of so many parts of the lineup.

The Yankees now hope Torres isn’t the latest key player to be lost to injury.

“We’ve obviously dealt with a lot of [injuries] over the course of the season,’’ Brett Gardner said. “He’s been one of the few guys that have lasted through everything. I was concerned, and obviously happy when he got back up. … Hopefully it’s something that’s not too serious.”