ST. LOUIS (AP) - Pinch-hitter Ramon Hernandez doubled in the go-ahead run in the 13th inning as Cincinnati survived blowing an eight-run lead and beat St. Louis 9-8 on Wednesday night to avoid a three-game sweep.
Chris Heisey, Jay Bruce, Fred Lewis and Scott Rolen homered for the Reds, who led 8-0 in the fifth but managed only three hits over the next seven innings.
Bruce walked and Drew Stubbs singled ahead of the hit by Hernandez, the last regular on the Cincinnati bench, off Raul Valdes (0-1).
Matt Holliday homered for the third time in two games and Albert Pujols had an RBI single in a five-run seventh for the Cardinals. Pujols was 1 for 6 in his first game since returning a month ahead of the timetable from a broken left wrist.
Jon Jay homered in the ninth off Francisco Cordero, only the third blown save in 20 chances for the Reds closer.
Daniel Descalso matched his career high with four hits and had two RBIs for St. Louis.
Jose Arredondo (1-3) allowed two hits and struck out two in two innings for the Reds, who had lost four of five. Aroldis Chapman allowed a hit before finishing for his first career save.
Giants 6, Padres 5, 14 innings
SAN FRANCISCO (AP) - Nate Schierholtz hit his second home run of the game leading off the bottom of the 14th inning for San Francisco.
Schierholtz had three hits and drove in three runs for the Giants, who beat the Padres for just the third time in 12 games at AT&T Park.
Javier Lopez (4-1) threw two scoreless innings while Pat Neshek (1-1) took the loss.
Pablo Sandoval drove in three runs, including the game-tying runs in the eighth inning, as the Giants rallied from a three-run deficit. Andres Torres had three hits.
Sandoval's two-run double came against Mike Adams, who had not allowed a run in 15 of his previous 16 appearances against the Giants.
Ryan Ludwick drove in two runs, Chase Headley, Jesus Guzman and Rob Johnson all had one RBI for the Padres, who had won 10 of their last 13.
The Giants snapped a three-game losing streak.
Nationals 5, Cubs 4
WASHINGTON (AP) - Wilson Ramos' suicide squeeze drove in Michael Morse in the seventh inning to lift Washington.
Ramos pulled off the tiebreaking sacrifice after missing the sign earlier in the count. He swung away with Morse charging home on the first pitch from Kerry Wood (1-4) but managed to foul it off.
Danny Espinosa and Ryan Zimmerman homered for the Nationals, and Carlos Pena and Aramis Ramirez did the same for the Cubs - all four coming with a man on base.
Ryan Mattheus (2-0) pitched one inning to get his second major league win - and second in five days - for the Nationals, whose each of their last 10 wins has been by either one run or in extra innings. They are 13-3 in one-run games since June 1.
Washington has won three straight and improved to 5-5 under manager Davey Johnson.
Drew Storen pitched the ninth for his 22nd save.
Zimmerman had two doubles along with his fourth homer, giving him his first three-hit game of the year. He has five hits in his last two games and is batting .218 since returning from abdominal surgery on June 14.
Astros 8, Pirates 2
PITTSBURGH (AP) - Hunter Pence had three hits, including an RBI single during a five-run sixth inning, and Houston snapped a five-game losing streak.
Houston took the field less than 90 minutes after a team meeting that lasted an hour and 15 minutes. The Astros had lost 10 of 11 and were 6-24 since June 3 and have the majors' worst record (30-58).
After Charlie Morton (7-5) limited Houston to three hits over the first five innings, seven of the eight batters who faced him in the sixth reached.
Bud Norris (5-6) allowed two runs over seven innings to win for the first time in five starts.
A day after climbing four games over .500 this late in a season for the first time in 19 years, the Pirates (45-42) fell back into third place in the NL Central by losing for the first time in four games.
The Astros had six hits and benefited from two errors in the sixth. Angel Sanchez, Carlos Lee, Jeff Keppinger and Clint Barmes also had RBI hits in the inning.
Braves 9, Rockies 1
ATLANTA (AP) - Chipper Jones hit a two-run homer and Jair Jurrjens earned his NL-leading 12th win for Atlanta.
Dan Uggla added a two-run homer in the eighth and Jordan Schafer had four hits for the Braves, who have won eight of their past nine, including three straight over Colorado.
Jurrjens (12-3) allowed one run, five hits and two walks in six innings. He has allowed no more than one run in four straight starts, leaving his NL-leading ERA at 1.87.
The Braves scored three runs in the first off Aaron Cook (0-4) before Jones' homer in the third pushed the lead to 5-0.
The Rockies (41-46) have lost four straight and are five games under .500 for the first time this season.
Marlins 7, Phillies 6, 10 innings
MIAMI (AP) - Mike Stanton hit a one-out solo homer in the 10th inning and Florida overcame an early four-run deficit to avert a series sweep.
Stanton hit a 2-1 pitch from Danys Baez (2-4) into the seats in left. He had been hitless in his previous four at-bats, striking out twice and grounding into a bases-loaded double play.
The home run was Stanton's 17th this season, and the first walkoff homer of his career.
Philadelphia's John Mayberry Jr. hit two home runs in the No. 8 spot in the order, and Jimmy Rollins also homered for the Phillies.
The Marlins won for only the second time in their past 17 games decided by one run. They ended a streak of seven consecutive losses to the Phillies, who lost for only the fifth time in 26 games at Miami since September 2008.
The Marlins' bullpen held Philadelphia without a hit over the final 4 2-3 innings.
Edward Mujica (6-2) pitched a perfect 10th.
Brewers 3, Diamondbacks 1
MILWAUKEE (AP) - Pinch-hitter Casey McGehee hit a three-run homer in the seventh inning for Milwaukee.
McGehee, benched three of the previous five games because of a season-long slump, hit his first home run since May 20. He had been hitting .171 since last homering.
Yovani Gallardo (10-5) allowed one run and four hits over seven innings, helping prevent Arizona from sweeping the Brewers for the first time.
Gallardo, who gave up a home run to Kelly Johnson on his third pitch of the game, struck out six and walked one.
John Axford earned his 22nd save in 24 chances by striking out the side in the ninth.
Arizona rookie Josh Collmenter pitched six shutout innings, allowing three hits. Reliever Joe Paterson (0-2) gave up consecutive singles in the seventh and was relieved by Sam Demel who gave up McGehee's homer.
Mets 5, Dodgers 3
LOS ANGELES (AP) - Ruben Tejada, filling in for the injured Jose Reyes, doubled home two runs, Carlos Beltran doubled twice and scored twice, and New York won its fourth straight.
Jonathon Niese (8-7) allowed three runs and five hits over seven innings, improving to 8-4 over his last 14 starts. The left-hander has won a career-best four straight outings on the road.
Bobby Parnell pitched a perfect eighth and Francisco Rodriguez got three outs for his 22nd save in 25 chances.
Hiroki Kuroda (6-10) gave up four runs and eight hits over six innings for Los Angeles, dropping to 1-5 with a 5.75 ERA in seven career starts against the Mets.
The Mets added a run in the ninth on Justin Turner's two-out RBI single. They have scored 166 runs with two outs, second in the majors to Boston's 170.