Crazy all-nighter ends as Giants beat Pirates in 13 innings

Updated 7:10 am, Tuesday, May 6, 2014

Hunter Pence receives a high-five after scoring the go-ahead run in the 13th.

Hunter Pence receives a high-five after scoring the go-ahead run in the 13th.

Photo: Gene J. Puskar, Associated Press

Image 2 of 14

Pittsburgh Pirates' Ike Davis slides safely into home plate against San Francisco Giants' Hector Sanchez in the seventh inning at PNC Park in Pittsburgh on Monday, May 5, 2014. (Matt Freed/Pittsburgh Post-Gazette/MCT) less

Pittsburgh Pirates' Ike Davis slides safely into home plate against San Francisco Giants' Hector Sanchez in the seventh inning at PNC Park in Pittsburgh on Monday, May 5, 2014. (Matt Freed/Pittsburgh ... more

Photo: Matt Freed, McClatchy-Tribune News Service

Image 3 of 14

San Francisco Giants' Hector Sanchez drives in teammate Buster Posey with a single off Pittsburgh Pirates relief pitcher Tony Watson during the seventh inning of a baseball game in Pittsburgh Monday, May 5, 2014. (AP Photo/Gene J. Puskar) less

San Francisco Giants' Hector Sanchez drives in teammate Buster Posey with a single off Pittsburgh Pirates relief pitcher Tony Watson during the seventh inning of a baseball game in Pittsburgh Monday, May 5, ... more

Photo: Gene J. Puskar, Associated Press

Image 4 of 14

PITTSBURGH, PA - MAY 05: Michael Morse #38 of the San Francisco Giants celebrates after scoring on a RBI single in the first inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Michael Morse #38 of the San Francisco Giants celebrates after scoring on a RBI single in the first inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in ... more

Photo: Justin K. Aller, Getty Images

Image 5 of 14

Pittsburgh Pirates' Starling Marte, right, slides safely around the tag of San Francisco Giants shortstop Brandon Crawford, left, with a stolen base during the third inning of a baseball game in Pittsburgh Monday, May 5, 2014. Giants manager Bruce Bochy called for a replay and the safe call was upheld. (AP Photo/Gene J. Puskar) less

Pittsburgh Pirates' Starling Marte, right, slides safely around the tag of San Francisco Giants shortstop Brandon Crawford, left, with a stolen base during the third inning of a baseball game in Pittsburgh ... more

Photo: Gene J. Puskar, Associated Press

Image 6 of 14

PITTSBURGH, PA - MAY 05: Buster Posey #28 of the San Francisco Giants hits an RBI single in the sixth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Buster Posey #28 of the San Francisco Giants hits an RBI single in the sixth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. ... more

Photo: Justin K. Aller, Getty Images

Image 7 of 14

PITTSBURGH, PA - MAY 05: Angel Pagan #16 of the San Francisco Giants celebrates after scoring on an RBI single in the sixth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Angel Pagan #16 of the San Francisco Giants celebrates after scoring on an RBI single in the sixth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in ... more

Photo: Justin K. Aller, Getty Images

Image 8 of 14

San Francisco Giants pitcher Jake Dunning collects himself after allowing two runs on two wild pitches during the fifth inning of a baseball game against the Pittsburgh Pirates in Pittsburgh Monday, May 5, 2014. (AP Photo/Gene J. Puskar) less

San Francisco Giants pitcher Jake Dunning collects himself after allowing two runs on two wild pitches during the fifth inning of a baseball game against the Pittsburgh Pirates in Pittsburgh Monday, May 5, ... more

Photo: Gene J. Puskar, Associated Press

Image 9 of 14

PITTSBURGH, PA - MAY 05: Brandon Crawford #35 of the San Francisco Giants turns a double play against Josh Harrison #5 of the Pittsburgh Pirates in the first inning during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Brandon Crawford #35 of the San Francisco Giants turns a double play against Josh Harrison #5 of the Pittsburgh Pirates in the first inning during the game at PNC Park May 5, 2014 in ... more

Photo: Justin K. Aller, Getty Images

Image 10 of 14

San Francisco Giants' Hunter Pence, right, is greeted by teammate Hector Sanchez (29) after scoring from third on a bunt by Giants pitcher Jean Machi during the 13th inning of a baseball game against the Pittsburgh Pirates in Pittsburgh Tuesday, May 6, 2014. The Giants won in 13 innings, 11-10. (AP Photo/Gene J. Puskar) less

San Francisco Giants' Hunter Pence, right, is greeted by teammate Hector Sanchez (29) after scoring from third on a bunt by Giants pitcher Jean Machi during the 13th inning of a baseball game against the ... more

Photo: Gene J. Puskar, Associated Press

Image 11 of 14

PITTSBURGH, PA - MAY 05: Hunter Pence #8 of the San Francisco Giants celebrates after scoring on a throwing error in the thirteenth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Hunter Pence #8 of the San Francisco Giants celebrates after scoring on a throwing error in the thirteenth inning against the Pittsburgh Pirates during the game at PNC Park May 5, ... more

Photo: Justin K. Aller, Getty Images

Image 12 of 14

PITTSBURGH, PA - MAY 05: Sergio Romo #54 of the San Francisco Giants celebrates after closing out the game in the thirteenth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Sergio Romo #54 of the San Francisco Giants celebrates after closing out the game in the thirteenth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in ... more

Photo: Justin K. Aller, Getty Images

Image 13 of 14

PITTSBURGH, PA - MAY 05: Hunter Pence #8 of the San Francisco Giants scores on a throwing error in the thirteenth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, Pennsylvania. (Photo by Justin K. Aller/Getty Images) less

PITTSBURGH, PA - MAY 05: Hunter Pence #8 of the San Francisco Giants scores on a throwing error in the thirteenth inning against the Pittsburgh Pirates during the game at PNC Park May 5, 2014 in Pittsburgh, ... more

But no, when a game goes 13 innings, ends at 12:36 a.m. local time and features two starting pitchers pinch-hitting, an umpire getting hit with a throw, two replay challenges, a 14-pitch strikeout, a blown 8-2 lead and a team that went 0-for-Atlanta with runners in scoring position getting eight hits in that situation, a screwy ending is preordained.

It had to be Jean Machi, asked to bunt for the first time as a professional, dropping down a beauty, busting his 255-pound body up the line and drawing an errant throw that allowed Hunter Pence to come around from second and deliver the Giants an 11-10 victory against the Pirates.

"In this kind of game, anything can happen, crazy things," said catcher Hector Sanchez, who had a month's worth of crazy over 5 hours, 29 minutes.

The Giants had a season-high 20 hits, yet none in the winning rally. They scored 11 runs, but did not homer for the first time in 12 games.

Sanchez had a career-high four hits, including three with runners in scoring position. He took his customary foul tips off the mask and chest, had a wild pitch bounce off his bare hand, dealt with a tight groin, had three runners steal off of him, caught all 13 innings and even did the postgame TV interview - all with a sore throat and nasal congestion.

More on the Giants

And manager Bruce Bochy had to leave him in because Buster Posey was already gone.

"I talked to Bochy," Sanchez said. "I'm taking the day off tomorrow."

Beneath a box score that looks like a baseball version of "War and Peace" lies the story of a team that would not disappear despite falling behind 8-2 in the fifth inning -the eight runs charged to Yusmeiro Petit- and being rewarded with a season-best sixth straight win.

"What a game," Bochy said. "It looked like we were dead in the water there. That was one of the grittier games I've seen with this group. We've had some good comebacks. This one's the best after you travel to get here and get down six runs."

They were behind 9-7 and 10-9 before they tied it in the ninth off Pirates closer Mark Melancon on a Pence single, wild pitch and Posey single.

Madison Bumgarner and Pirates starter Gerrit Cole both pinch-hit in extra innings, and Santiago Casilla struck out Neil Walker on 14 pitches, but Machi made the difference after he escaped big jams in the 11th and 12th innings.

Reliever Jared Hughes walked Pence then hit 1-for-17 Juan Perez. With one out, Bochy had Machi sacrifice the runners to give Sanchez one crack at a two-run hit.

Machi's bunt up the third-base line was pretty. Hughes got to the ball and must have been stunned to see how far up the line Machi had gotten. His throw bounced, and Walker could not make the grab at first. As the ball flicked into the air, Pence scored the winning run .

"I've always been a good player," Machi said through interpreter Edwin Higueros. "I think the pitcher was a little slow reacting to get the ball. When I saw that I used all the speed I had."

Latest from the SFGATE homepage:

Click below for the top news from around the Bay Area and beyond. Sign up for our newsletters to be the first to learn about breaking news and more. Go to 'Sign In' and 'Manage Profile' at the top of the page.