ST. LOUIS -- When his heart rate finally drops to acceptable levels -- if that's even possible in the coming days -- Phillies closer Ryan Madson might be able look back on his work in a tenuous eighth and ninth inning Tuesday night in appreciation.

Or he'll just let out a massive sigh.

The Phils' bullpen backed six scoreless innings from starting pitching Cole Hamels by walking the tightrope in the final three innings before Madson retired red-hot Ryan Theriot for the final out of Game 3 of the National League Division Series, stranding the tying run in a 3-2 win over the Cardinals.

"These games are important, obviously, and we're ready to pitch any time," Madson said. "I was ready in the eighth any time, so it wasn't a surprise. It was interesting, and it was fun."

And it was nerve-wracking.

In a series in which St. Louis blew a three-run lead in Game 1 and Philadelphia squandered a four-run lead in Game 2, the Phils' bullpen finally shut the door. It was gut-check time for Madson and fellow relievers Vance Worley, Antonio Bastardo and Brad Lidge.

Madson recorded a rare five-out save, getting a bases-loaded double play to end the eighth inning, as the Phillies' bullpen held the Cardinals to two runs in three innings -- just enough to push Philadelphia to within a game of advancing.

"That's the thing," Madson said, "You don't have to be perfect. You just have to make pitches one at a time."

After Ben Francisco's three-run homer in the seventh gave the Phils a 3-0 lead, Worley weaved his way around the heart of the Cards' order in the seventh inning, allowing a run on an RBI single by David Freese. He got Yadier Molina to fly out and strand two runners on base.

Worley started the eighth, but was quickly pulled when Theriot got his fourth hit -- a bloop single to right -- to lead off the inning. Bastardo retired pinch-hitter Nick Punto and was replaced by Lidge, who gave up a pair of singles to load the bases.

"They have scrappy hitters and some balls found some holes, and they did a good job of getting guys on base," Lidge said. "That's kind of what these guys have been doing. They've been doing a good job of it, but fortunately, we were able to get a big double play there and finish it off."

With the sellout crowed whipped into a frenzy, Phillies manager Charlie Manuel summoned his closer with one out in the eighth.

"That's the first time I've used Madson for four or five outs, and I figured that the game was right there on the line and we had to stop them," Manuel said. "He came in and did a super heck of a job."

Madson, who had two prior career saves of five outs or more, promptly got Allen Craig to hit into a double play to end the inning and steal the moment from the Cardinals.

"They're all good pitchers," Theriot said. "They're big league pitchers -- an incredible staff that we're up against. I thought Cole threw the ball well, got in a few jams and got himself out, and then Worley came in and their bullpen did a good job."

Perhaps the biggest thing about the inning-ending double play was St. Louis slugger Albert Pujols would start the ninth with no one on base and without a chance to tie the game with one swing.

"I didn't think that far ahead," Madson said. "I was just focused on that guy and trying to get him to roll into a double play."

Pujols led off the ninth with a double, and he scored on a two-out single by Molina that cut the lead to 3-2 and brought the potential game-winning run to the plate. And wouldn't you know, it would be Theriot, who was 6-for-8 in the series heading into that at-bat.

No worries. Madson got him to roll over and ground out to end the game.

"That was a huge game, definitely a turning point in the series," Madson said. "[Wednesday,] we'll go out there with a lot of confidence and hopefully score a bunch of runs and just take it on home."