The Nationals' Trea Turner slugs his second home run of the day Sunday, a walk-off solo homer that let Washington salvage the final game of its season-opening series. (Tommy Gilligan/USA Today Sports)

The line drive cut in and out of the afternoon shadows, through a sideways wind and not far above the left field grass, before it nestled into the first few rows beyond the fence.

Only then did Nationals Park, so recently full of grumbles, erupt into one loud cheer. The Washington Nationals emptied out of the home dugout and formed a crowd around home plate. Trea Turner trotted along the base paths. He had just delivered the Nationals’ first win of the season, a 6-5 victory Sunday over the New York Mets, with a ninth-inning home run that turned frustration into celebration with a single swing. It was his second homer of the day — the first scored three runs in the third — and he hit it by turning on a low-and-inside fastball from Mets left-hander Justin Wilson.

It came after the Nationals’ bullpen imploded, for the second straight day, by allowing the Mets to erase Washington’s three-run, eighth-inning lead. Turner bailed out those relievers right when Washington really needed him to. The win, however dicey, let the Nationals sidestep a sweep and gain traction before welcoming Bryce Harper and the Philadelphia Phillies on Tuesday night.

“It wasn’t the way we scripted it,” said Manager Dave Martinez, taking a heavy breath before his postgame news conference. “But we’ll take it.”

The first three games of the season have raised questions about the Nationals’ bullpen, their situational hitting and the fundamentals they emphasized throughout spring training. Trevor Rosenthal, their new setup man, has faced five hitters without recording an out. Sean Doolittle, their all-star closer, was up and down in his first appearance of the year Sunday. They lost a tight game Opening Day and a lopsided one Saturday, then nearly let the Mets flip the scoreboard after seven strong innings Sunday.

But Turner has been one of the bright spots, tampering any early doubt and again showing that Washington has a 25-year-old franchise shortstop who can run, hit for power and field. He finished 2 for 5 with those two homers, three runs and four RBI in the series finale. He collected his fourth steal in four attempts and flashed his defensive ability with a leaping throw to first and a quick double play turn. He also saved the day.

When Turner came to the plate in the third with runners at the corners and no outs, it was the same situation he stumbled in three days earlier. Then, against Mets ace Jacob deGrom, Turner struck out on a high fastball and kept his team off the board in an eventual 2-0 loss. He had expected to attempt a safety squeeze, a small-ball tactic the Nationals have discussed, but Martinez instead had him swing away. It didn’t go well, so Turner considered bunting against Zack Wheeler on Sunday. He was glad he didn’t — bunts can’t produce home runs — and he had a quick word for Martinez before they shared a high-five.

“I came back in the dugout and said I thought about bunting because they didn’t give me the bunt sign,” Turner recalled. “I thought about it, but I gave myself a pitch to hit, and I asked him if he was okay with that. And he said, ‘Yeah.’ "

Patrick Corbin exited his Nationals debut after giving up two earned runs in six innings. Washington had a three-run lead and still did after Justin Miller worked a scoreless seventh, but it didn’t last. On Saturday, Rosenthal, Kyle Barraclough, Matt Grace and Wander Suero couldn’t slow the Mets in the eighth and ninth. On Sunday, Tony Sipp, Rosenthal and Doolittle gave up the three eighth-inning runs that knotted the score. The Mets collected eight eighth-inning runs on 11 hits in the series, exposing how much bullpen improvement the Nationals need as the calendar turns to April.

Sipp gave up a leadoff hit to Robinson Cano and another single to Michael Conforto two batters later before Rosenthal replaced him. The plan was for Rosenthal to face one hitter, matching up with the right-handed Amed Rosario, and he gave up a first-pitch RBI single before he was hooked. That set up Doolittle for a five-out save opportunity, but two-out RBI singles from Wilson Ramos and Juan Lagares brought the Mets all the way back.

Doolittle threw 11 pitches in the eighth and came out for the ninth. He ran into some trouble there, with his count pitch climbing to 30, but he retired the Mets and gave the Nationals a chance to win it in the bottom of the inning. Turner took that opportunity, on a 3-2 pitch, and Doolittle, Rosenthal and Sipp could exhale.

“It’s a lot easier to kind of go back to the drawing board and reevaluate what you did or maybe didn’t do during the game after a win,” Doolittle said. “So when your teammates bail you out, that’s the chemistry that we talked about. That’s playing team baseball for the whole entire game we talked about. We’ve already started talking about some things that we can do differently the next time we face these guys.”

This was only the third game of the season, and the Nationals have many more chances to correct the issues that have clouded their start. But they were dragging, for two games and once the Mets came back Sunday, making Turner’s home run feel all kinds of critical — just in time, just over the wall and just enough to avoid thinking about what a season-opening sweep would have felt like.

“I don’t know,” Turner said with a smile. “We won.”

More on the Nationals:

Bryce Harper will face Max Scherzer in his first game back at Nationals Park

For Opening Day, Nats fans ripped, defaced and marked up their Bryce Harper jerseys