Giants players douse Joc Pederson after his game-winning single in the 11nth inning Sunday against the Boston Red Sox in San Francisco. John Hefti/Associated Press

SAN FRANCISCO — Joc Pederson singled in Patrick Bailey in the 11th inning, and the San Francisco Giants beat Boston 4-3 on Sunday for their first home series win against the Red Sox since 2004.

Bailey began the inning at second base. After Casey Schmitt was hit by a pitch from Mauricio Llovera (1-1), Brandon Crawford attempted to sacrifice the runners over. But Boston catcher Connor Wong was unable to field the bunt cleanly and Crawford reached on an infield single.

Pederson then lined a 1-2 sinker from Llovera into right field.

It was the second walk-off RBI this season for Pederson. He drew a bases-loaded walk to beat San Diego on June 20.

“You definitely want to be aggressive,” Pederson said. “The pressure’s on the pitcher. They’re wanting to throw strikes and not get behind in the count. That definitely plays into it.”

Wilmer Flores and Luis Matos each had two hits for San Francisco (58-48), which is on top of the NL wild-card standings after winning six of seven.

Advertisement

“Some teams just have a flair for some late-inning heroics. Seems like this team has that for sure,” said Ross Stripling, who pitched 4 1/3 innings of one-run ball in relief of opener Scott Alexander. “Sometimes we don’t even come alive until like the seventh inning. The struggles that we’ve been through have brought us really close together as a group.”

Justin Turner and Adam Duvall homered for Boston. The Red Sox have lost consecutive road series for the first time this season.

Boston missed a chance to take the lead in the top of the 10th when Tristan Beck (2-0) got Yu Chang to strike out swinging with two runners on.

The Giants were up 2-1 in the eighth when Turner hit his 17th homer, a two-run shot off Tyler Rogers.

San Francisco tied the game in the bottom of the eighth on a single by Michael Conforto, a double by Matos and a groundout by Patrick Bailey.

Turner’s drive to left spoiled a strong outing by Stripling, one of San Francisco’s top offseason acquisitions. He allowed four hits, struck out three and walked none. Duvall ended Stripling’s outing with a leadoff homer in the seventh.

Advertisement

FOR OPENERS

Alexander threw 16 pitches and retired five batters. Boston’s Brennan Bernardino allowed one hit and one run on 27 pitches in one inning of work.

San Francisco improved to 13-4 this season when using an opener.

GOLD GLOVE GEM

Crawford returned to the lineup after missing 12 games because of left knee inflammation, and the shortstop showed why he’s still considered one of the best infielders in the game. The four-time Gold Glove winner snared Justin Turner’s sharp grounder in the sixth, then made a backhanded flip to second baseman Schmitt, who threw to first to complete a double play.

“What I see is a team that’s playing really good defense and pretty consistent defense,” San Francisco Manager Gabe Kapler said. “In the biggest moments, we’re making plays.”