ST. LOUIS (AP) Jeff Samardzija looked to be in command. Then the long balls just kept coming.
The San Francisco Giants right-hander surrendered four home runs in a span of nine at-bats, going from a four-run cushion to two runs down in a 7-4 loss to the St. Louis Cardinals on Saturday night.
''I don't think anything was anything out of the ordinary,'' Samardzija said. ''Unfortunately I got into a situation where I got a couple pitches up, especially that 3-0 one, and they took advantage of it.''
Samardzija (7-4) had given up five homers in 80 innings all season, and just one in his previous five outings. He opened with four routine innings, permitting three singles and no runner past first base.
The rest of his outing was a flashback to last season, when he gave up an American League-leading 29 homers for the White Sox.
''He was cruising there,'' manager Bruce Bochy said. ''We're hoping he regroups. But he lost command. It happens.''
Rookie Aledmys Diaz lined a tying, three-run shot off the foul pole on a 3-0 count in the fifth. Brandon Moss got the long-ball binge started with his 11th leading off the fifth. Stephen Piscotty and Matt Adams hit consecutive homers in a matter of three pitches to open the sixth.
Samardzija said Piscotty hit a fastball away, Adams a changeup, Moss a full-count cut fastball and that the pitch to Diaz was simply a fastball up.
''I don't know, man, they've got to tell me where the home run zone is,'' Samardzija said.
But he added: ''You've got a four-run lead there, you've got to make it stick. So, that hurts.''
Samardzija will get extra rest, along with other starters due to days off, before his next start on Saturday. He insisted fatigue was not an issue.
''I feel good, man,'' he said. ''My arm feels great, I'm in great shape.''
The rally rescued Michael Wacha, who left trailing 4-0 after five seemingly on track for a seventh consecutive loss. Wacha has allowed 23 earned runs in his last 23 innings.
Tyler Lyons (2-0), Seung Hwan Oh and Kevin Siegrist each worked a hitless inning before Trevor Rosenthal set the side down in order in the ninth for his ninth save in 10 chances. Rosenthal walked all three batters and was charged with three runs in the Giants' 5-1 victory Friday.
Diaz banged his eighth homer off the foul pole just below the third deck in left, a drive estimated at 426 feet. Piscotty and Adams have seven homers apiece.
Joe Panik doubled twice with an RBI, Brandon Crawford doubled and tripled and Samardzija had an RBI single for the NL West-leading Giants, who are 18-5 in their last 23 games.
Giants: Jake Peavy (2-5, 6.34) is coming off his best start, pitching one-hit ball for seven innings against Atlanta. The right-hander will get extra rest due to off days for the team and pitch again in next Sunday's nationally televised game.
Cardinals: Carlos Martinez (5-5, 3.69) struck out eight in eight scoreless innings his last start at Milwaukee, ending a career-worst five-game losing streak.
Giants: Matt Cain (hamstring) is scheduled to throw his second bullpen session Sunday and if all goes well could throw a simulated game Wednesday that could be the final test before returning to the rotation. Cain threw 20 pitches off a mound on Friday.
Cardinals: SS Jhonny Peralta (thumb) remains on track to be activated from the DL on Tuesday. He started Saturday for Class A Palm Beach, but will likely primarily play at 3B when he returns due to the emergence of Diaz.
GET A HIT
Wacha had been 0 for 19 with 10 strikeouts on the year before a swinging bunt single in the third.