For a few moments Sunday, between pitches in the eighth inning, Gabe Kapler vacated his usual position on the steps of the Phillies' dugout to retrieve a cup of water. It was nearly 100 degrees on the field at Citizens Bank Park. Hydration was essential.

Surely, though, Kapler could have used a beverage with more kick.

The Phillies were nearing the end of a 42-game run in which they faced 10 teams with a combined winning percentage of .545, a grueling stretch of schedule that tested the mettle of Kapler's roster, the youngest in baseball.

And Kapler was managing the series finale against the Washington Nationals like it was Game 7 of the World Series. He lifted starting pitcher Jake Arrieta for a pinch-hitter with the Phillies down by three runs in the fifth inning. He emptied his bullpen, using all seven available relievers before turning to a starter (Nick Pivetta) for three outs. He pulled more strings than a marionette puppeteer.

By the time the Phillies began batting in the bottom of the 13th inning, Kapler had told third baseman Jesmuel Valentin that he would pitch the 14th, a last resort that was two outs from actually happening. But backup catcher Andrew Knapp, after more than four hours baking on the bench, slugged a pinch-hit solo homer to save the day in an exhausting 4-3 victory and make all of his manager's maneuverings pay off.

"That was cool," Knapp said. "That was a huge team win, huge team series. For the bullpen to step up and keep throwing zeroes up was awesome. It was a great team effort."

Said Arrieta: "No offense to Val, but I really don't want to see him pitch in that game. Being on the bench for the entire day and coming off, to be able to hit a walk-off home run like that is very impressive. A fun moment for us to win the series."

The Phillies completed their 42-game challenge with a 21-21 record. They head into a well-deserved day off Monday with a 45-37 record and in second place in the National League East, three games behind the front-running Braves but also three games ahead of the heavily favored Nationals.

"It shows we're here to stay," Knapp said.

Knapp got the decisive hit, the Phillies' first walk-off homer since Ryan Howard's on April 29, 2016. But the bullpen was the collective unsung hero.

Kapler weighed how much his relievers had worked in the previous two games — 7 1/3 innings Friday night and seven innings Saturday. He knew Yacksel Rios and rookie phenom Seranthony Dominguez were unavailable in any circumstance. And yet he still pulled Arrieta for a pinch-hitter with two on and one out in the fifth inning and the Nationals leading 3-0, an aggressive move that led to a game-tying rally.

"You have to find a way to score runs," Kapler said. "You're running out of outs. You're down. They have a closer in the eighth inning in [Kelvin] Herrera. You just don't have that many opportunities to score in a baseball game, so you have to capitalize when you have that opportunity. It's not always going to work out."

That it did was a credit to so many relievers. Rookie lefty Austin Davis struck out Juan Soto, Anthony Rendon and Bryce Harper — the middle of the Nats' order — in the sixth inning; Tommy Hunter got the final out of the seventh less than 24 hours after throwing 38 pitches; Victor Arano tossed a scoreless 12th inning, his third appearance in as many games; Jake Thompson rolled into the clubhouse at 11 a.m. after arriving from triple-A and held down the Nationals in the ninth, 10th and 11th innings.

According to the Elias Sports Bureau, it marked the first time the Phillies' bullpen worked at least seven innings in three consecutive games since July 28-30, 1928.

"Tremendous amount of confidence built the last couple of days," Kapler said. "Our bullpen is going to come back from the off-day extremely confident."

The Phillies' next 16 games are against teams with losing records. It will be up to them to take advantage. But in completing the toughest stretch of their season by going 6-4 against the Nationals and the New York Yankees, they proved a point.

"We're up there with a lot of those [contending] teams," Knapp said. "This was a huge series win for us, especially coming off the series win in Washington. They wanted to come here and sweep us. For us to take three of four was cool."