WASHINGTON — Yes, the Mets lost a chance to gain ground in their postseason push. It's also true they dropped two of three to the Nationals. Here's another fact: The Mets put themselves in position for the playoffs with their recent surge, a point manager Terry Collins intends on pushing.

Tanner Roark pitched seven scoreless innings and Wilson Ramos homered in the seventh inning for the game's only run as the Washington Nationals beat the Mets 1-0 on Wednesday.

With one out in the seventh, Ramos hit his 21st home run deep over the center-field wall on the first pitch from Fernando Salas (0-1).

The Mets finished 6-3 on their nine-game road trip. The Mets had won eight of 10 and were 17-6 over their previous 23 games.

Entering Wednesday, the Mets were the second NL wild card, a half-game back of the Giants and a half-game ahead of the Cardinals. San Francisco and St. Louis also lost Wednesday.

"We've got ourselves right where we need to be," Collins said. "Yeah, today's tough when the other two teams lose. But they're saying the same thing."

Salas, who was 3-6 with the Angels, had not allowed a run in seven appearances since being acquired from Los Angeles on Aug. 31.

Roark (15-8) allowed three hits with seven strikeouts and four walks, one intentional. The Nationals have won five of six.

Reliever Blake Treinen pitched the eighth and Mark Melancon got the final three outs for his 42 save.

Mets starter Robert Gsellman tossed 5 2/3 scoreless innings, allowing five hits with four walks.

The Mets return home for a 10-game homestand starting Friday.

"We're going home in the wild-card hunt. Our fans should be excited," Collins said. "They've been waiting. It's the last homestand. They should be excited to come out and, you know, see what happens in these 10 games. I don't care who we're playing, they're big games. This is a big time of year."

Nationals manager Dusty Baker was not with the team in the series finale because of a death in the family. Bench coach Chris Speier managed team in Baker's absence.

Roark is 1-2 with a 1.27 ERA in four appearances against the Mets this season including three starts. The right-hander threw at least seven shutouts innings for a major league-leading ninth time this season.