Credit the save to Aaron Altherr.

Down to their final out and faced with the prospect of another demoralizing late-inning loss Monday night, the Phillies were rescued by Altherr. His sinking line drive skipped by diving St. Louis Cardinals left fielder Marcell Ozuna and went for a two-run double in a feel-good 6-5 walk-off victory at Citizens Bank Park.

"He's worked so hard, he's had so many struggles, he's had so many lineouts," manager Gabe Kapler said of Altherr. "It was really nice to see a ball bounce in his direction tonight."

But the Phillies were relieved for reasons that go beyond Altherr's hard-luck .180 batting average. Altherr brought a feel-good ending to a difficult day for the bullpen and a rough ninth inning for catcher Andrew Knapp.

The Phillies had the game won when closer-du-jour Victor Arano — Kapler's choice in the absence of demoted Hector Neris and with rookie phenom Seranthony Dominguez unavailable after throwing 52 pitches in the previous two games — struck out Yairo Munoz on a dirt-diving slider. But Knapp was unable to block the ball, allowing Munoz to reach on a wild pitch, a run to score and the game to remain alive for the Cardinals to tie it one batter later.

"I've got to make that play. I've got to block it," Knapp said after the Phillies pulled into a tie for second place in the National League East with the Washington Nationals. "I've blocked that pitch a million times. This one just got under my glove. A little shorter than I thought it was going to be. Just misplayed it."

After the wild pitch cut the margin to 4-3, Kapler turned to lefthander Adam Morgan to get out lefty-hitting Kolten Wong. But Morgan, who entered with a 17.18 ERA in June, gave up a single through the middle that knocked in the tying run. And when recently recalled Jake Thompson gave up a leadoff homer to Tommy Pham in the 10th inning, it seemed the Phillies were headed for another difficult defeat.

Kapler defended Arano, who allowed a single and a double with one out but nevertheless recorded three outs in the ninth inning. He also continued to defend his decision not to appoint one reliever for the ninth inning, a bullpen experiment that might well pay off but is highly unconventional.

"Is it hurting us?" Kapler said of not having one closer. "I think every team except the Dodgers would like to have Kenley Jansen, of course. Everybody wants to have a guy that's absolutely lights-out dominant. Those guys don't grow on trees and I really like our guys."

Until the ninth inning, the story was starter Nick Pivetta. The righthander recorded a career-high 13 strikeouts and made the Cardinals swing and miss 21 times in a 7 1/3-inning gem. His fastball reached 96 mph, his curveball was devastatingly effective, and his slider was a solid third pitch.

"Nick deserved to get that 'W,' " Knapp said. "The guy pitched amazing. He had everything working. The ninth inning didn't go the way we wanted, but yeah, it was huge for us to come back at that time right there."

Indeed, Altherr made it all moot. Having entered the game in the eighth inning when right fielder Nick Williams played a fly ball off his face, Altherr came to the plate with two outs. Rhys Hoskins was on second base after a leadoff single, and Carlos Santana was on first after being intentionally walked.

"It just shows how resilient we are as a team," Altherr said. "Obviously, we wanted to win the game in the ninth, but they just happened to get the two runs across and we just stayed positive."