MILWAUKEE (AP) - Yovani Gallardo and manager Ron Roenicke couldn't figure it out.
The pitcher had a streak of 16 2-3-innings without giving up a run snapped in the first when he allowed three of them, and the San Francisco Giants held on for a 7-4 victory over the Milwaukee Brewers on Wednesday night.
"It was just one of those days," Gallardo said. "I can't pinpoint one thing. Obviously command was a big issue."
San Francisco Giants catcher Buster Posey holds on to the ball after tagging out Milwaukee Brewers' Rickie Weeks at home during the seventh inning, Wednesday, in Milwaukee. Weeks tried to score from third on a ball hit by Ryan Braun.
Gallardo (6-6) gave up four runs on nine hits and walked four in four innings. His only shorter outing this season was May 20 at Atlanta when he left after 3 1-3-innings with an ankle injury.
"Lately, he's been pretty good, so I don't know what happened today," said Roenicke, who managed his 600th game with the Brewers.
Michael Morse and Pablo Sandoval each drove in three runs for the Giants, who won for the fifth time in the last seven games.
Ryan Vogelsong (7-8) won consecutive starts for the first time since May. On Friday, the right-hander allowed two hits in a complete game against the Mets.
"Stuff I was doing the last start didn't work today, so it was kind of a weird day," Vogelsong said. "It kind of felt like I was trying something new every inning and I was just fortunate enough to have balls hit right at people. I made some pitches when I needed to, but it wasn't really how I wanted to draw it up."
Morse hadn't had more than one RBI in a game since June 13 against Colorado, and the left fielder had only eight RBI in his previous 50 games.
But after a run-scoring single by Sandoval in the first, Morse's snapped a 1-for-11 skid with a two-out, two-run single to center for a 3-0 lead. In the fourth, his single to right with two outs gave San Francisco a 4-1 lead. The last time Morse had three RBI was May 29.
Sandoval smashed a two-run homer to left for a 7-3 lead in the eighth, one day after the third baseman hit a three-run shot.
Carlos Gomez homered in the first for Milwaukee, Aramis Ramirez added a two-run single in the seventh and Khris Davis hit a solo homer in the ninth. The Brewers still kept a one-game lead over St. Louis in the N.L. Central despite falling to 3-6 in their last nine games.
Giants: Centerfielder Angel Pagan (back inflammation) was expected to join the team late Wednesday after he finished his minor-league rehab assignment Tuesday with Triple-A Fresno.
Brewers: Second baseman Scooter Gennett returned to the starting lineup after missing four of the last five games with quadriceps tightness.
Giants: Jake Peavy (0-2, 4.85 ERA) is 0-3 with a 3.43 ERA in four career starts in Milwaukee.
Brewers: Wily Peralta (13-6, 3.52 ERA) has won his last four starts while posting a 1.71 ERA.
Several Milwaukee players took a group 'selfie' before the game. A small stand of bleachers was carted onto the field, and the Brewers - in full uniform - squished together. With his tongue sticking out, Gomez snapped the picture while standing in front of his teammates.
With two outs and the bases loaded in the first, Vogelsong hit a chopper up the middle that was fielded by shortstop Jean Segura. He tried to get the force out at second, but Brandon Crawford beat him to the base. Vogelsong stopped short of first base, however, thinking Crawford was out. So Segura threw him out to end the inning and take a run away from the Giants.