Bryce Harper reacts after being hit by a pitch from the Yankees' CC Sabathia during the fifth inning of Tuesday’s game in New York. Harper was plunked again in the eighth, this time in the foot, and had to leave the game. (Justin Lane/EPA-EFE/Shutterstock)

Bryce Harper tried walking the pain off. He took a few slow steps toward first base, seemingly intent on staying in his first game at Yankee Stadium in three years, but he didn’t shuffle far. Before a trainer could reach him, Harper was limping off the field to the visitors’ dugout, unable to apply much weight on his left foot. His night was over in the eighth inning Tuesday, and the Washington Nationals’ latest injury scare had just begun.

The Nationals went on to lose to the New York Yankees, 3-0, running their scoreless innings streak to 19, but the game’s result became secondary once Dellin Betances’ 0-2 slider plunked Harper on the left big toe. On a night when the Nationals finally welcomed back Daniel Murphy, Harper, their foundational middle-of-the-lineup piece, became the latest injury concern. For a few minutes, the Nationals wondered if they would have to sustain another loss.

But the Nationals quickly found out that, for once, they caught a break. After the game, Harper walked into Manager Dave Martinez’s office to inform him the toe was okay. X-rays on his toe were negative. He was dealing with some pain, but Harper and the Nationals evaded the worst. Martinez said he expects him to be back in the Nationals’ lineup Wednesday for their series finale against the Yankees, owners of the best record in baseball at 43-19.

“I’m fine,” Harper said.

Harper began his day as everyone expected: dancing around a few indirect questions at his locker about his impending free agency from some New York media members. He played along as he did last month at Nationals Park, careful not to supply any back-page headlines. He succeeded. A few hours later, Harper, a Yankees fan growing up in Las Vegas, was showered with light boos before his first plate appearance in the Bronx since 2015. It concluded with a walk.

He walked again in the third inning before he was hit by a 90-mph sinker in the right elbow by Yankees left-hander CC Sabathia in the fifth. Harper dropped to the ground in pain, holding his elbow, which was unprotected. Trainers and Martinez rushed to check on Harper, but he stayed in the game and took his base after a couple of minutes.

Ultimately, the initial scare provided the Nationals (36-28) with a scoring opportunity, putting runners on first and second with two outs for cleanup hitter Anthony Rendon. But Rendon lined out to Didi Gregorius at shortstop to terminate the threat. That was the third and final time the Nationals put multiple runners on base in an inning as they wasted another quality outing from Tanner Roark.

Roark needed 15 pitches to retire the side with two strikeouts in the first inning before striking out Giancarlo Stanton on three pitches to begin the bottom of the second. Then things got rocky. First, Gregorius, who entered the night batting .167 with one home run since April 29, blasted a solo shot. Aaron Hicks followed with a walk before Neil Walker smacked a single, a play that ended with him at second base because Harper opted to throw to third base to try to nab Hicks. The ball bounced past third baseman Rendon, leaving runners on second and third. Austin Romine’s sacrifice fly then doubled the Yankees’ lead.

But New York would strike just once more, in the sixth, when Gregorius connected with his second homer off Roark. The right-hander kept the Nationals in the game against baseball’s most potent offense, allowing three runs on six hits across six innings. But a lack of run support, a theme for Roark this season, plagued him again Tuesday.

While Roark deftly navigated a lineup featuring Aaron Judge and Stanton, the 37-year-old Sabathia silenced Washington’s bats with a blend of breaking pitches and a sinker that didn’t break 90 mph. He allowed four hits, struck out three and walked three across 5 ⅔ innings.

“It happens. I stay optimistic,” Roark said. “I’m not going to let it get to me. I’m just going to pitch my game and give it all that I can until I’m out of the game. Stay optimistic. Once you let the bad thoughts creep in your head, it all goes downhill from there. Continue to work hard and trust it. Have faith.”

The Yankees’ bullpen offered a different look with a trio of hard throwers, beginning with right-hander Chad Green. The Nationals managed just one hit off the Yankees’ relief corps — a single by Wilmer Difo off Green in the seventh — before Betances and Aroldis Chapman shut the door on the most complete lineup the Nationals have fielded in months.

Playing in his second game since undergoing ankle surgery after a day off Sunday, Adam Eaton supplied one of the Nationals’ five hits, finishing 1 for 4 with a strikeout. Meanwhile, Murphy, playing in his first major league game since having microfracture surgery on his right knee in October, finished 0 for 4 with two strikeouts as the Nationals’ designated hitter.

“Wouldn’t say rusty,” Martinez said of Murphy. “His timing could have been a little off. But I know he’s going to hit. So we get him back and see how he feels [Wednesday] and then we’ll go from there. But he’s going to be fine.”

Those two additions couldn’t help the Nationals score their first run since the seventh inning Saturday. Ultimately, however, that took a back seat to the temporary concern surrounding Harper. It’s a result they will trade for the good news any day.