PHOENIX (AP) The Arizona Diamondbacks looked headed for a seventh straight loss and more disappointment at home. Then Welington Castillo brought smiles and relief.
The catcher's three-run homer in the eighth inning rallied Arizona to a 6-5 victory over the San Francisco Giants on Saturday night.
Castillo ripped reliever Hunter Strickland's 2-1 pitch into the stands in left field with one out. The Giants led 5-3 going into the inning, but starter Jeff Samardzija and reliever Josh Osich each put runners on base.
''I just was waiting for something over the plate and close to me that I can put a good swing on it,'' Castillo said. ''It means a lot, especially here at home.''
Strickland (3-1) replaced Osich and gave up the game's biggest hit.
''I tried to throw a two-seamer, left it over the plate and it didn't move. I would say he got the best of it, Strickland said. ''I was trying to throw it in. I was trying to get a ground ball.''
Jake Barrett (1-0) earned his first major league win in relief and Brad Ziegler got his 17th save of the season.
Brandon Crawford and Mac Williamson hit back-to-back home runs to give the Giants a 5-1 lead in the fourth. Williamson's blast flew well over the 413-feet sign in left-center field and off the bottom left corner of the Chase Field video board.
The Diamondbacks avoided their longest losing streak of the season.
''It's huge. It flips the whole thing around,'' manager Chip Hale said. ''We got the one pitch from Strickland and did some damage to it.''
Diamondbacks first baseman Paul Goldschmidt made a diving stop and putout to end the game with a runner on first for the Giants.
''That is one we let get away,'' Giants manager Bruce Bochy said.
The Giants scored their first three runs in the second inning. Buster Posey walked, took third on a single and scored on a fielder's choice when Diamondbacks shortstop Jean Segura threw wide to home plate for an error after fielding Williamson's grounder.
Recent callup Ruben Tejada's first hit and RBI as a Giant came one out later, on a single to drive in Crawford. Then Samardzija grounded to Segura, who bobbled the ball and could only get one out to allow Williamson to score.
Patrick Corbin doubled and scored in the fourth thanks to teammate Michael Bourn's hustle. Bourn beat out what looked to be an inning-ending double-play grounder at first base, allowing Corbin to score from third.
Castillo and Chris Herrmann doubled in runs in the fifth - Herrmann's drive close to being a home run to right-center field - to cut the Giants' lead to two.
Hale was ejected before the top of the seventh inning, arguing with home plate umpire Brian Knight soon after Herrmann was called out on strikes. It was Hale's second ejection of the season.
IT'S A BOY
Diamondbacks infielder Nick Ahmed is on paternity leave after the birth of his first child, a son. Ahmed left Friday's game before it ended to be with his wife Amanda, and could return to the team by Monday.
The Diamondbacks made a roster move to replace Ahmed before Saturday's game, recalling reliever Enrique Burgos from Triple-A Reno.
Diamondbacks outfielder Rickie Weeks Jr. is expected to return from bereavement leave on Sunday, at which time the team will make another roster move to add him, Hale said. Weeks has been away from the team since Thursday.
Giants: OF Denard Span got another day off due to neck stiffness but could be back by Sunday. ... OF Hunter Pence (hamstring strain) took on-field batting practice Saturday. He's been on the 15-day disabled list for a month. ... Starting pitcher Matt Cain was scheduled to throw 45 pitches in a minor-league game Saturday as he returns from a hamstring strain. ... INF Ramiro Pena (ankle) was available for pinch-hitting duty Saturday. ... 2B Joe Panik (concussion) is still resting and is eligible to return Tuesday.
Diamondbacks: Hale said ace Zack Greinke felt better during Friday's game, and the team has yet to decide whether to place Greinke on the disabled list with a left oblique injury. Greinke was expected to undergo a scan Saturday to determine if he has a strain. Greinke could pitch as soon as next weekend if all is well and can still be named an NL All-Star, but may not pitch in San Diego. ... OF David Peralta and OF-IF Chris Owings, both on the 15-day disabled list, are moving closer to being able to play in games. They could be back in action after the All-Star break, Hale said. OF Socrates Brito (fractured toe) is also close to returning from the DL.
Giants: Sunday's scheduled starter is Albert Suarez (3-1, 3.83 earned run average), who is in the rotation in place of Cain. ''He's done such a great job in whatever role we've put him in,'' Bochy said.
Diamondbacks: Sunday starter Robbie Ray (4-7, 4.69 ERA) is 1-0 with a 1.64 ERA in two starts against the Giants in his career. He is averaging 10.42 strikeouts per nine innings pitched, which is in the top 10 in the NL.