Bryce Harper seemed almost surprised Wednesday night when he fielded the ball in right field and noticed that the potential tying run for Baltimore was headed home. The ball was not hit particularly hard to Harper with two outs in the eighth inning of a 4-3 win, but the Orioles still decided to test the outfielder’s arm.

Challenge accepted.

Harper threw flat-footed from shallow right field and fired a 89.2 mph strike to home, easily beating the run of Baltimore catcher Pedro Severino and allowing J.T. Realmuto to apply the inning-ending tag. It pushed the Phillies within three outs of a needed win and prevented the bullpen from blowing another lead.

“He fielded it almost like an infielder, set his feet and threw an absolute rocket to home plate,” first baseman Matt Vierling said. “It was a huge play and a clutch play by him. He’s a clutch player.”

The win moved the Phillies four games above .500 with 10 games remaining. At worst, they’ll start Thursday three games behind first-place Atlanta, which finishes a series Thursday in Arizona while the Phillies open a four-game set at home vs. the Pittsburgh Pirates.

The Phillies ended the eighth with Harper’s throw and started it with a terrific catch at first by Vierling, who snagged a line drive by Ryan Mountcastle. It could have been a different inning for reliever Cam Bedrosian if his defense didn’t support him the way it did.

“We win by one run and he throws the guy out,” manager Joe Girardi said of Harper. “That’s a big run.”

Walking Harper

The crowd booed in the bottom of the seventh when Harper jogged to first base after being intentionally walked. The player they came to see in South Philly was being denied a chance at bolstering his MVP case by delivering a needed insurance run.

» READ MORE: Ten years, 1,222 games and no playoffs: Phillies’ Jean Segura hopes to finally break through

For the second straight night, the Orioles challenged another Phillies hitter to beat them. And it is a strategy that will likely be employed often during the season’s final 10 games. But the crowd was not booing for long.

Realmuto, who delivered Tuesday’s walk-off hit after Harper was intentionally walked, came through again with a single up the middle to give the Phillies a two-run lead. Opposing teams — especially Atlanta next week — will be tempted to give first base to Harper, baseball’s hottest hitter in the season’s second half, and test their luck against whoever is batting behind him.

But the best way to quell that temptation is to do what Realmuto has done for two straight nights.

“It’s a way to do it, but I still think they are going to be cautious just because of who Bryce is and the three-month run he’s on,” Girardi said. “I think they’re going to be cautious.”

Wheeler’s night

Girardi said earlier this month that Zack Wheeler’s pitch count would be capped near 100 pitches for the rest of the season and there was no budging from that on Wednesday. Wheeler was lifted after throwing 97 pitches in six innings, turning the final three innings to the bullpen.

“If he would have had an easy six, I probably would have let him go,” Girardi said. “But because he had thrown a bunch of pitches and was close to 100 pitches, I felt like we had to get something going.”

The bullpen did not make it easy as Sam Coonrod allowed a tying run in the seventh after Andrew McCutchen hit a go-ahead homer in the sixth and Bedrosian nearly blew a two-run lead in the eighth. It still worked out. Ian Kennedy made it interesting in the ninth, but still got the save.

Wheeler struck out nine, allowed one run on four hits, walked two, and escaped a pair of jams that could have changed the game. He induced a double play to end the second after the Orioles and runners on first and third with one out and stranded Cedric Mullins on third base after Baltimore’s best hitter hit a two-out triple in the third.

“I thought he did a really good job,” Girardi said.

Wheeler’s lone run scored on a double by Austin Hays as Mountcastle sprinted all the way from first base. The Phillies might have been able to get the out at home if Didi Gregorius’ relay throw had been on target. Instead, it was high and Mountcastle scored with ease.

Playing Didi

Gregorius said last week that he’s in a platoon at shortstop, but the Phillies continue to play him in an everyday role.

Girardi started Gregorius against left-hander Keegan Akin despite Gregorius entering Wednesday with a .156 batting averageagainst left-handers. Gregorius went 0-for-2 against Akin and finished the night 0-for-4 to drop his season average to .209.

“If we’re going to do anything, Didi has to hit,” said Girardi. “That’s the bottom line. I like the experience he has going out there every day in that type of situation and I’m going with the experience.”

The Phillies could have replaced Gregorius with right-hander Luke Williams, but Girardi said the Phillies felt comfortable with Gregorius since Akin’s numbers are slightly better against right-handers than left-handers.