SAN FRANCISCO -- Yasmany Tomas' fourth-inning home run proved to be the difference as the D-backs overcame a poor start from Shelby Miller to beat the Giants, 6-2, on Thursday afternoon and sweep the four-game series at AT&T Park. Arizona has now won 10 of 11 and 12 of 14 in San Francisco.
"It's not easy to sweep anybody in four games at the Major League level, especially a team like that in this ballpark," D-backs manager Chip Hale said. "I'm very proud of our guys; they battled. It wasn't easy. Obviously, Shelby struggled early to throw strikes."
The D-backs built a 2-0 lead thanks to a pair of RBIs from Paul Goldschmidt in the first and third innings, but the Giants capitalized on Miller's command struggles to score two runs in the third and tie the game.
Tomas untied it when he hit a 3-2 pitch from Johnny Cueto over the wall in left-center. Cueto (3-1) took the loss but pitched well in scattering eight hits over seven innings. The two RBI hits he allowed to Goldschmidt included a grounder down the line at third and a bloop single to right.
"That's part of the game," Cueto said. "I was trying to throw a sinker [to Tomas] but the ball just stayed up."
MOMENTS THAT MATTERED Win and a save:Tyler Wagner came on for Miller in the third and picked up his first Major League win while tossing five shutout innings, but he also deserved a save for giving Arizona's overworked bullpen a much-needed break. Wagner worked seven scoreless innings during the series.
"I think today everything was working -- sinker, cutter, changeup and the slurve that I throw," Wagner said. "So I think just working with [catcher Chris] Herrmann and mixing things up."
Coming up empty: Miller's control problems in the third manifested into four straight walks, although the suddenly soft-hitting Giants weren't able to do much with it. After the bases-loaded walk produced the Giants' first run, they got a second run on Brandon Belt's double-play grounder, but Brandon Crawford grounded out meekly to end the inning. It's become a familiar pattern over the past week for manager Bruce Bochy's ballclub, which has lost eight of nine.
"We need somebody to inject some life into this offense and get a big hit," Bochy said. "They were trying to give us the game. If it wasn't for the walks, we'd probably get shut out, to be honest."
Miller's mechanics: Miller spent his between-starts bullpen session working on his mechanics to avoid hitting his hand on the pitcher's mound like he did in his last start against the Padres.
"No, I didn't hit it on the ground again," Miller said. "I felt like I'm just mechanically off. I'll have a couple of good innings here and there, and then things kind of fell out of whack for me in the third. I didn't feel like I could get the ball in the strike zone."
Two-out hits derail Cueto: Tomas' home run provided the difference in the final score, but it was a pair of two-out singles in the third that really hurt San Francisco's right-hander. Cueto had retired seven straight batters until Jake Lamb singled and stole second. Goldschmidt followed with a sharp single to right on an 0-1 pitch to drive in Lamb and put Arizona up 2-0. Cueto allowed only one other two-out hit -- a bunt single by Chris Owings in the fourth.
One day after nearly getting hit in the face by a Josh Osich pitch, D-backs outfielder David Peralta was hit in the elbow area by the Giants left-hander in the eighth inning. Peralta angrily tossed his bat and had some words for Osich. Both benches emptied, but only words seemed to be exchanged as order was quickly restored and both teams were issued warnings.
"I'm not that type of guy to react like that, but it's two days in a row; I had to say something," Peralta said. "I guess he couldn't control the fastball in, and he's throwing 98. The game's over, though; it's time to turn the page."
UPON FURTHER REVIEW
The D-backs lost a manager's challenge in the fourth when Owings reached first on a bunt single with two outs and was picked off first by Cueto. Owings was initially called out, and after a brief review, officials determined the call would stand, which means there was not enough video evidence to overturn the decision.
WHAT'S NEXT D-backs: After a 10-game road trip, the D-backs return to Chase Field to take on the Pirates on Friday in the first of a three-game series. Patrick Corbin, who has been the team's most consistent starter this year, will get the start in the game, which begins at 6:40 p.m. MST.
Giants: San Francisco continues its longest homestand of the first half Friday at AT&T Park against San Diego at 7:15 p.m. PT. Right-hander Jeff Samardzija will be making his regular-season home debut with the Giants after making his first three starts on the road.
Steve Gilbert has covered the D-backs for MLB.com since 2001. Follow him on Twitter @SteveGilbertMLB. Mike Wagaman is a contributor for MLB.com based in the San Francisco Bay Area. This story was not subject to the approval of Major League Baseball or its clubs.