Carlos Beltran stopped so abruptly at first base after a first-inning single Tuesday night that it appeared as if he was not hustling on what could have been a double.

The truth was potentially much more painful for the Yankees. Beltran pulled up because he felt tightness in his right hamstring. A few minutes later, he was exiting the field and heading for an appointment with an MRI tube.

Beltran’s injury overshadowed the latest Yankees loss, a 7-1 defeat to Cole Hamels and the Rangers before 32,373 at Yankee Stadium.

The Yankees haven’t exactly been hitting the cover off the ball with Beltran, who at 39 has been their best player. After his first-inning hit, Beltran is batting .297 with 19 home runs and 53 RBIs.

How long he will be stuck on those numbers wasn’t immediately known as the Yankees were still determining the severity of the injury.

Beltran stopped after rounding first base on what could have been a double as the ball was bobbled in the leftfield corner by Ryan Rua.

Within minutes, it was clear why Beltran didn’t try for second when manager Joe Girardi and trainer Steve Donohue emerged from the dugout. After a brief examination, Beltran left the field.

He was replaced on the bases and then in rightfield by Rob Refsnyder, who will probably inherit some of Beltran’s playing time along with Aaron Hicks.

General manager Brian Cashman has been lukewarm about bringing up top prospect Aaron Judge, who has been on a tear all month and leads the International League with 16 home runs.

Alex Rodriguez, who returned to the lineup against the lefthander Hamels after getting benched vs. two straight righthanders, went 0-for-3 with a sacrifice fly and two strikeouts.

The Yankees did little against Hamels, who improved to 9-1 by throwing seven shutout innings.

Hamels outdueled CC Sabathia (5-5), who rebounded from a poor previous outing and a sprained ankle to pitch into the eighth. Sabathia’s final line was worse than he pitched because of Texas’ five-run eighth.

The Rangers scored three batters into the game when Adrian Beltre hit a two-run homer to right. Hamels took care of the rest. He gave up six hits, walked one and struck out seven in an 86-pitch breeze.

Texas knocked out Sabathia in the eighth. Beltre had an RBI single. Prince Fielder had an RBI double. Nomar Mazara greeted Anthony Swarzak with an RBI single. Rougned Odor followed with an RBI single. Jurickson Profar drove in the final run with an infield single as the Rangers batted around.

Sabathia was charged with six runs in seven-plus innings. He gave up eight hits, walked one and struck out two.

Girardi had stressed the importance of winning Tuesday night’s game after the Yankees suffered a frustrating 9-6 loss in Monday’s game, which ended at 2:44 on Tuesday morning. After a three-hour, 35-minute rain delay that cost them the services of closer Aroldis Chapman, Kirby Yates hit three batters and allowed four runs in the ninth inning to erase a 6-5 lead.