David Butler II-USA TODAY Sports

Mike Yastrzemski hit a solo home run and the visiting San Francisco Giants avoided a series sweep by beating the Boston Red Sox 3-1 on Thursday in the final game of a three-game set.

Yastrzemski's home run was his third of the season and came hours after he was visited in the clubhouse by his grandfather and Red Sox legend, Carl Yastrzemski.

It was Mike Yastrzemski's second career home run in six games at Fenway Park after his grandfather hit 237 of his 452 home runs at Fenway.

The Giants broke a 1-1 tie by scoring twice in the seventh. Patrick Bailey singled, took third on Matt Chapman's single and scored on a single by Thairo Estrada. Nick Ahmed added a sacrifice fly that drove in Chapman to make it 3-1. Both runs were charged to Zack Kelly (0-1).

The victory ended Boston's four-game winning streak. The Red Sox won the first two games of the series 4-0 and 6-2.

Ryan Walker (3-2) earned the win for the Giants with a scoreless sixth inning. He allowed one hit and struck out one. Camilo Doval worked the ninth to earn his sixth save.

San Francisco has not scored more than three runs in any of its last seven games. The Giants have generated 16 runs during that seven-game stretch.

Boston starting pitcher Josh Winckowksi went 4 1/3 innings and allowed a run on two hits. San Francisco starter Kyle Harrison pitched five innings, giving up a run on three hits with five walks and seven strikeouts.

Yastrzemski's home run opened the scoring in the third, but Boston tied the game in the bottom half of the inning when Rafael Devers led off the inning with a single and scored on Tyler O'Neill's double.

Zack Short, who was acquired in a trade with the New York Mets on Wednesday, made his Red Sox debut Thursday. Short started at second base and hit ninth in the batting order. He was 0 for 3 and struck out twice.

Boston will begin a three-game series at Minnesota on Friday. San Francisco will remain on the road and will open a four-game series against Philadelphia on Friday.

More must-reads:

TODAY'S BEST
Team Penske tops the charts in NASCAR Cup Series practice at Gateway
Kings make huge decision on head coach Mike Brown
Oilers beat Stars to take 3-2 lead in WCF
Orioles lose two starting pitchers to season-ending surgeries
Yankees' Aaron Judge, Juan Soto make MLB history with impressive offensive numbers
Caitlin Clark frustrated by physical WNBA play: 'I feel like I'm getting hammered'
Bills give Olympic gold medalist chance in NFL
An epic temper tantrum highlighted Day 6 of the French Open
Broncos' Sean Payton shares promising Bo Nix update amid competition
Celtics HC Joe Mazzulla blasts media for Jayson Tatum, Jaylen Brown coverage
Pistons parting ways with GM after hiring new head of ops
Mike Tyson-Jake Paul fight temporarily postponed
Suns fill out Mike Budenholzer's coaching staff
Timberwolves boycotted TNT in support of criticized bigs
Watch: Oilers offense responds after big hit on Corey Perry
Seahawks WR doesn’t hold back on praise for QB Sam Howell
Report: Cowboys quietly 'all in' on Dak Prescott decision
Diamondbacks ace heading to injured list with hamstring strain
Golden Knights, key winger have mutual interest but face financial crunch
Pelicans to defer Lakers' first-rounder to 2025