PITTSBURGH (AP) - Bryan Morris entered the game in the sixth inning with the bases loaded in relief of Jeff Locke and allowed all three runners to score.
That was the start of a bad night for Pirates relievers Monday that ended when Jared Hughes' throwing error in the 13th inning allowed the Giants to score the winning run as San Francisco rallied from six runs down to beat Pittsburgh 11-10.
''Well, it basically got to our location not being good,'' Pirates manager Clint Hurdle said of his bullpen's struggles. ''We were up in the zone more than we normally are.''
Hughes (1-1) came on to start the 13th with the score tied 10-10. With one out, he walked Hunter Pence and hit Juan Perez with a pitch to put runners on first and second base.
Beefy reliever Jean Machi then came to the plate and was given the bunt sign for the first time in his 13-year professional career that stretches back to playing for the Philadelphia Phillies' farm club in the rookie-level Gulf Coast League in 2002.
Not only did Machi execute the bunt for a sacrifice, but he caused Hughes to rush a wide throw to first base. Pence scored on the error as San Francisco ran its winning streak to season-best six games and also won for the 10th time in 11 games.
The Pirates lost for the 18th time in 23 games.
''I saw (Hughes) got a late break off the mound and slipped and I knew I had to run hard,'' Machi said through a translator. ''I was excited because I did my job. They wanted me to move the runners up and I did that.''
After Sergio Romo pitched a scoreless 13th for his 10th save, Machi (5-0), who pitched two scoreless innings, wound up tied for the major league lead in victories with three starting pitchers - the Los Angeles Dodgers' Zack Greinke, St. Louis Cardinals' Adam Wainwright and Toronto Blue Jays' Mark Buehrle.
Machi spent two seasons in the Pirates' farm system in 2010-11.
The Pirates could have used Machi in this game. In addition to Morris' struggles, six relievers combined to give up four runs in 7 2-3 innings and were the primary culprit in Pittsburgh blowing the 8-2 lead it built after five innings.
Mark Melancon blew a save opportunity in the ninth when he gave up a run-scoring single by Buster Posey that tied the score at 10-10 and forced extra innings.
Locke was charged with six runs in 5 1-3 innings after being recalled from Triple-A Indianapolis earlier in the day. The Pirates needed a spot starter after their rotation was scrambled last week by back-to-back rainouts in Baltimore.
Locke was an NL All-Star last year and then faltered in the second half. The left-hander went 8-2 with a 2.15 ERA in 18 starts before the break, but just 2-5 with a 6.12 ERA after that.
This year, Locke was 0-1 with a 5.68 ERA in four starts for Indianapolis. He was limited to just two innings in spring training because of a strained oblique muscle and began the season on the disabled list.
Locke said he felt no nervousness in his return to the major leagues.
''I really took it the same way I normally would,'' he said. ''Came in, went over hitters the same way we normally would. It was literally the most comfortable I'd felt all season.''
The Pirates' Andrew McCutchen had four hits, including a double and a triple, while Pedro Alvarez hit a three-run home run and drove in four runs.
Giants backup catcher Hector Sanchez had four hits and three RBIs, while Posey, who got a day off from catching, had three hits, three runs scored and two RBIs.
NOTES: Pirates RHP Jason Grilli played catch for the second time in three days but there is no timetable for when the closer, who is on the DL with a strained left oblique, will be able to throw off a mound. ... RHP Casey Sadler was optioned to Indianapolis to open a roster spot for Locke. ... San Francisco 1B Brandon Belt, who entered the game in a 2-for-29 slump, did not start but went 1-for-2 with a walk off the bench.