Any thought of a perfect game exited Jacob deGrom's mind when a line drive by Phillies pitcher Zach Eflin lashed over his head. The single in the third inning Sunday gave the Phillies their lone hit in a 5-0 loss to the New York Mets at Citizens Bank Park.

It was at that moment, DeGrom said, that he shifted his focus toward attaining his first shutout, which he completed in dominant fashion with seven strikeouts and just one walk. The righthander pitched brilliantly, but he may have been flirting with perfection had it not been for that fastball he grooved to Eflin. Ryan Howard - the other Phillies base runner - reached on a walk in the eighth.

"Just a two-seamer that ran back over the middle," deGrom said about the pitch to Eflin. "It is what it is."

DeGrom was the 15th pitcher since 1971 to allow two base runners or fewer in Philadelphia. It was the first time since 2010 that the Phillies' lone hit came from a pitcher. DeGrom kept the Phillies off balance with excellent fastball command, which only made his slider and change-up stronger.

Maikel Franco, who went 0 for 3, called deGrom's fastball "sneaky." DeGrom threw six consecutive fastballs to strike out Peter Bourjos in the first. He struck out Howard in second by throwing fastballs on five of the six pitches. His fastball - which topped out at 95 mph - was so dominant that the pitcher rarely had to stray from it.

"He's got everything you need to be a successful pitcher," Phillies manager Pete Mackanin said. "Throws strikes, changes speed, has great location. You look at what he did today with his location and changing speed. Same thing with [Bartolo] Colon, moving in and out with the ball. Throwing strikes where he wants to."

DeGrom's performance overshadowed Eflin, who allowed three runs in six innings. All of Eflin's runs scored with two outs. He worked an 0-2 count on Curtis Granderson in the third inning before throwing three balls. Granderson then rocketed the sixth pitch of the at-bat into the visiting bullpen in right-center field.

Eflin showed poise in the fifth as he loaded the bases after allowing a run. His outing looked ready to implode before he escaped the jam, retiring Neil Walker on a groundout. The righthander has a 2.56 ERA in his last six starts as he continues to distance himself from his troublesome debut in Toronto.

"I didn't have my best stuff today, but I was able to battle and limit the damage," Eflin said.

The Mets decided last week that it was best that deGrom skipped the All-Star Game to rest for the second half. The pitcher spent the four-day break at home in Florida, and rest proved to be the right choice on Sunday.

The pitcher was as crisp in the ninth inning as he was in the first. DeGrom's final pitch - the 105th he fired - was a 95-mph fastball. Odubel Herrera chased it and the pitcher turned toward the outfield before waiting near the mound for catcher Rene Rivera. DeGrom opened his mitt and Rivera dropped the ball inside. The pitcher's day was finished and the Phillies offense was silenced.

"It's frustrating when a guy is dominating you for pretty much the whole day," catcher Cameron Rupp said. ". . . He pitched well. You've got to give a little bit of credit to that guy."