MIAMI (AP) Two days after Brandon Crawford battered the Miami Marlins with seven hits, he beat them with one swing.
Crawford homered in the fourth inning and the San Francisco Giants won a series for the first time since the All-Star break, beating Miami 1-0 Wednesday.
Crawford's seven hits in the opener of the three-game set tied an NL record. In the finale he put San Francisco ahead with his 11th homer leading off the fourth inning.
''He had a great series,'' manager Bruce Bochy said. ''We needed a shot in the arm, and he gave it to us.''
Crawford, who went 9 for 16 in the series to hike his average to .277, pulled a 3-2 changeup from David Phelps over the fence.
''They had been mixing on me pretty good the past couple of days,'' Crawford said. ''I had to be ready for anything. Fortunately I hit the changeup pretty good.''
Before the game, Crawford posed for photos with Rennie Stennett, who paid a visit to offer congratulations. Crawford's seven-hit game was the first since Stennett went 7 for 7 at Wrigley Field in 1975.
The Giants finished 4-5 on their trip and improved to 8-16 since the All-Star break. They have a one-game lead over the Los Angeles Dodgers in the NL West. Philadelphia beat the Dodgers 6-2 on Wednesday.
While their frustration eased, on the Marlins' side it peaked in the sixth inning, when hitting coach Barry Bonds was ejected for arguing after pinch hitter Chris Johnson took a called third strike to end a threat.
''He didn't think it was a strike,'' Johnson said. ''And I didn't think it was a strike.''
Bonds was in the dugout when plate umpire Cory Blaser gave him the thumb. Bonds then came onto the field to briefly argue further before being pulled away by manager Don Mattingly.
Despite the early departure, Bonds didn't miss any runs by his team. Jeff Samardzija (10-8) pitched 5 2/3 innings to best his former Notre Dame teammate, David Phelps, and four Giants relievers completed a five-hitter.
Santiago Casilla pitched around a two-out double in the ninth by Ichiro Suzuki, striking out J.T. Realmuto to earn his 26th save.
''With that one-run lead, I was trying to protect it,'' Samardzija said. ''You have to tip your hat to our bullpen - to go 3 1/3 innings and hold them at 1-0, they should get the win.''
Samardzija had lost his past three starts.
Suzuki singled and doubled to increase his career hit total to 3,002, and teammate Marcell Ozuna singled to end an 0-for-18 slump. But Miami bunched two hits in an inning only once - in the second - and Derek Dietrich was thrown out trying to stretch a single into a double.
The Giants won with six hits, and took the series despite scoring just one run in the final 24 innings.
''We're too good of a ballclub for this to continue,'' Bochy said. ''We'll get the bats going. These guys have it in them. I'm not concerned about them.''
Phelps (5-6), making his second start of the season after moving from the bullpen into the rotation, pitched five innings and allowed one run - on Crawford's homer.
''Whoever said solo home runs don't beat you is a liar,'' Phelps said. ''I was telling myself not to walk him. That's what happens when you do that. I threw a pitch in the middle of the plate and he timed it up.''
Marlins slugger Giancarlo Stanton, nursing a sore right hip, pinch-hit with two on in the fifth and flied out to end the inning. Mattingly said he hopes Stanton will be able to return to the starting lineup for the Marlins' next game Friday.
Both teams have Thursday off. The Giants begin a 10-game homestand Friday against Baltimore, with RHP Matt Cain (4-6, 5.16) scheduled to start against RHP Dylan Bundy (5-3, 3.05).
RHP Andrew Cashner (4-8, 4.96) is scheduled to start for the Marlins when they begin a three-game series Friday against the Chicago White Sox. It will be the first game for the White Sox in Miami since 2004.