WASHINGTON (AP) — Dave Martinez's words were drenched with emotion as he stood in a booze-soaked clubhouse, Washington Nationals players celebrating all around after clinching an NL wild card exactly four months after they woke up with a 19-31 record and calls for him to be replaced as manager.

Quite a turnaround for Martinez — and for his club.

"They don't want to go home. They want to keep playing," Martinez said Tuesday night, wearing the same red T-shirt reading "Let's get wild" as his players had on. "They don't quit."

Trea Turner's go-ahead grand slam in the sixth inning lifted Washington to a 6-5 comeback victory over the Philadelphia Phillies for a doubleheader sweep that assured the Nationals of extending their season and eliminated the Phillies from playoff contention.

"They're resilient. Perfect example: Tonight they were down, but they never feel like they're out," Martinez said. "They stick together. And here we are, going to the postseason."

He missed three full games and part of another this month because of a heart issue; the 54-year-old skipper was back in the dugout four days after having a cardiac catheterization.

"They keep telling me how much they want to play for me," Martinez said in the mayhem, his voice cracking. "And I tell them it's not about me. It's about us. Just play for us."

Washington is returning to the playoffs for the fifth time in eight years after sitting out October in 2018, when the team went 82-80 in Martinez's rookie year as a manager.

Things started roughly in 2019: Washington was 12 games below .500 after a loss on May 23 concluded a four-game sweep at the New York Mets.

At that point, the Nationals were fourth in the NL East, thanks to defensive sloppiness, bad baserunning and, above all, unreliable-as-can-be work from the bullpen.

But Martinez retained his always-sunny disposition and remained in his post, unwilling to publicly criticize his players and, in a participation-trophy sort of way, often pointing out how hard they had tried in defeat.

Eventually, things clicked. Washington went on a real roll, even playing winning baseball while Max Scherzer took two trips to the injured list with a back muscle problem.

Perhaps fittingly, it was three-time Cy Young Award winner Scherzer (11-7) who got the clinching win despite a rocky start, allowing a pair of homers to Brad Miller as Washington fell behind 4-2. But much like the way the entire season went, the Nationals dug themselves out.

"We knew nothing was going to be won or lost in the first five months," said Turner, who had three hits in the day's first game, a 4-1 win for the Nationals, "and now we're in a good spot."

The Nationals entered Tuesday hoping to beat Philadelphia twice plus get a loss by the Chicago Cubs at Pittsburgh — and each of those things happened.

Right after center fielder Victor Robles made a running catch for the last out of the second game in Washington, the Nationals Park scoreboard showed the Cubs vs. the Pirates.

Many of Washington's players stood on their stadium's infield and watched the end of the Cubs' 9-2 defeat, then started celebrating there before heading indoors for the real deal, which included red cans of Budweiser, blue cans of Bud Light, white cans of Stella Artois and bottles of Campo Viejo Cava.

"With everything we went through as a group," reliever Sean Doolittle said, "it feels so much sweeter."

Anthony Rendon delivered two sacrifice flies to raise his majors-leading RBIs total to 124 in the opening victory, a result that also eliminated Philadelphia and $330 million outfielder Bryce Harper, the ex-Nationals star.

"I've got no hard feelings towards them at all. They're a great team. They're a great organization," Harper said. "That's why they're at where they're at right now."

In the nightcap, Washington trailed 4-2 entering the sixth — and at that moment, about 250 miles away, the Cubs were leading the Pirates 1-0.

Everything changed within minutes.

While Washington was loading the bases against Aaron Nola (12-7) with two walks and a single — setting the stage for Turner's 18th homer of the season and second career slam, which came off Jared Hughes — the Cubs were imploding during the Pirates' seven-run seventh.

Turner's drive to left made it 6-4, and he celebrated with the Nationals' customary dugout dance line and a curtain call. The clubhouse party included a loud rendition, naturally, of "Baby Shark," the walkup song for midseason acquisition Gerardo Parra, who brought a dose of levity to his new club.

Harper drew loud boos from spectators all day, especially when he stepped in as a pinch hitter in the second game. That was in the seventh to face, of all people, Hunter Strickland, with whom the 2015 NL MVP has a complicated history that includes playoff homers and a brawl when the slugger was with Washington and the reliever with San Francisco.

Harper got the best of this matchup, turning on a 98 mph offering and depositing it in the second deck.

That made it 6-5, but Daniel Hudson closed out both ends of the doubleheader to raise his save total with Washington to five in seven chances.

"At the end of the day they're still doing what they're doing," Harper said, "and we're going to go on a bus to go home. "

HE SAID IT

Asked about his future as Philadelphia's skipper, Gabe Kapler replied: "There's going to be plenty of opportunity to reflect. I love this organization. I love this team, specifically. I love working for this front office. I love working for this ownership group. I'm going to manage this club as long as I can, because I think I give us a great chance to win and I care deeply about the success of this franchise."

UP NEXT

Washington RHP Aníbal Sánchez (10-8, 3.91 ERA) faces LHP Drew Smyly (4-7, 6.44 ERA) Wednesday.