PITTSBURGH (AP) Trevor Rosenthal didn't panic and neither did his manager, Mike Matheny.
Rosenthal, the St. Louis Cardinals' closer, got into a major ninth-inning jam, allowed the Pittsburgh Pirates to draw within a run and then load the bases with none out. It seemed the Pirates, who lead the major leagues with five walkoff victories, were on the verge of doing it again.
However, Rosenthal escaped the jam for his 10th save and Shelby Miller won his fourth straight start as the Cardinals held on for a 6-5 win Sunday night.
''That felt like a walk-off win right there,'' Matheny said with a relieved smile. ''That was beyond impressive what Trevor was able to do there at the end to get it back together. That's why he is pitching at the end of games.''
Rosenthal survived an RBI single by Andrew McCutchen to notch his 10th save as the Cardinals avoided their first three-game losing streak of the season. He got Ike Davis to foul out for the first out then induced Jordy Mercer to hit into a 1-2-3 double play to end it.
''I just wanted to throw a fastball low in the zone and either get him to hit it on the ground or strike out,'' Rosenthal said. ''It couldn't have worked out any better, though I'm sure the rest of the guys in this clubhouse wish I could have got the job done sooner.''
Allen Craig and Yadier Molina had two hits each, including RBI singles in a four-run first inning. Craig went 5-for-11 in the three-game series after entering with a .202 batting average. Molina was 0-for-12 in his previous four games.
''Hopefully, this is a spark,'' Matheny said. ''We've been looking for that thing that can get us clicking.''
Miller (5-2) walked four and allowed four hits in 5 1-3 innings, but held the Pirates to just two runs - which came on Mercer's first home run of the season in the fourth inning.
''I didn't have much but I gave it what I got and fortunately it was enough to help us get a win,'' Miller said.
Charlie Morton (0-5) was charged with only one earned run of the four he allowed over six innings but remained winless since Sept. 2, a span of 14 starts. He also fell to 2-10 in his career against the Cardinals.
''I just tried to get back out there and put up zeroes after that first inning,'' Morton said. ''We kept chipping away and we almost pulled it out but I can't give up four runs there, especially in the first inning. It put us in a bad spot from the start.''
Pittsburgh's Pedro Alvarez had three hits.
Jon Jay also has two hits for St. Louis as did Tony Sanchez for the Pirates, whose season-best four-game winning streak ended.
Mark Ellis also had an RBI single in the first inning for St. Louis and Craig added a sacrifice fly.
NOTES: McCutchen returned to the lineup after missing Saturday's game with soreness in his left ankle. ... Pittsburgh LF Starling Marte was not in the lineup because of lower back tightness, which caused him to leave Saturday night's game in the fourth inning. ... Pirates RF Travis Snider batted leadoff after missing the previous two games while serving a suspension from Major League Baseball for his actions April 20 in a benches-clearing brawl with the Milwaukee Brewers. ... Bourjos, who started the previous four games, did not start because of a cut on his right wrist that came as a result of getting spiked Saturday night while attempting to break up a double play. However, he entered the game in the game in the seventh inning as a defensive replacement. ... The Cardinals host the Chicago Cubs on Monday night in the opener of a four-game series with LHP Tyler Lyons (0-2, 3.45) facing LHP Travis Wood (2-4, 4.75). ... The Pirates are off Monday then begin a three-game series Tuesday night at Milwaukee.