A game that had a perfect ending for the Mets, thanks to Wilmer Flores, originally got off to a perfect start, thanks to Matt Harvey.

Flores -- who was in tears on the field Wednesday night after the Mets agreed to trade him -- not only got to stay when the deal fell through but ended Friday night's game with a walk-off home run that produced a dramatic 2-1 win over the first-place Nationals.

Harvey retired the first 16 batters he faced, carrying a perfect game into the sixth inning. He then allowed a one-out single by Jose Lobaton, who hit a liner just past a diving Flores at second base.

Working the outside corner of the plate effectively all night, Harvey tossed 7 2/3 innings, allowing one run, five hits and no walks with nine strikeouts in a no-decision.

"Being able to throw a slider and work off of that and also be able to locate my fastball a little bit better has made a huge difference," Harvey said. "I'm excited for my next outing."

Combined with Harvey's previous outing against Washington on June 20, in which he retired the final 14 batters he faced, he had set down 30 consecutive Nationals before losing his perfect game Friday night. In eight career starts against Washington, Harvey is 3-2 with a 0.99 ERA.

advertisement | advertise on newsday

After the Mets moved within two games of the NL East-leading Nationals, Terry Collins was asked if he had ever seen Harvey hit the corners as well as he did Friday.

"Not this year I haven't. That's the best command, I thought, on both sides of the plate he's had all year," he said. "Again, I think as we've been trying to indicate that we're going to have some ups and downs as the season goes along. But tonight, he was ready for tonight's game."

Harvey retired the first two batters in the eighth before hitting pinch hitter Clint Robinson. The play was reviewed but upheld (after the game, Harvey called it too close to overturn). Harvey then allowed an infield single by Anthony Rendon to put runners on first and second. One strike away from escaping the inning, Harvey gave up a single to center by Yunel Escobar that tied the score at 1-1.

"Today, obviously, one pitch would have gotten us out of here a little bit sooner," Harvey said.

Everyone stuck around a little longer, but it proved to be worthwhile because it set the stage for Flores' perfect ending.

Mets videos

"I mean, words can't really describe what's been going through his head and us as a team the last couple of days," Harvey said. "Obviously, everything that happened to him is pretty incredible, and for tonight to happen the way it did, it's pretty unreal. Everybody is so happy for him."