Ian Happ and Dansby Swanson hit back-to-back homers as the Cubs hold off the Giants 6-5

Ian Happ hit a 442-foot homer, Dansby Swanson made it back-to-back longballs and the Chicago Cubs hung on to beat the San Francisco Giants 6-5 on Wednesday.

Jorge Soler made it interesting in the eighth inning with a 444-foot grand slam over the bleachers in left field against Tyson Miller that got the Giants within one, but Colten Brewer pitched around back-to-back walks to Wilmer Flores and Brett Wisely in the ninth and finished for his first save.

Kyle Hendricks (1-4) pitched neatly into the sixth inning, allowing one run on two hits in his longest outing of the season and lowering his ERA from 8.20 to 7.46.

There was a moment of silence before the game for Willie Mays, and the Giants wore patches on their jerseys in honor of the Hall of Famer, who died on Tuesday.

Happ and Swanson connected against reliever Spencer Bivens (1-1) in a three-run fourth. Swanson went deep for the second straight game, and he also drove in two with a single in a three-run seventh.

Swanson then helped another run score when he got caught in a rundown trying to steal with Michael Busch batting. First baseman Wilmer Flores dropped a throw, and Christopher Morel came home from third, bumping Chicago’s lead to 6-1.

In the eighth, Mark Leiter Jr. walked Matt Chapman and Austin Slater with two outs to set up Soler's second career grand slam.

Hendricks was sharp in his first start since May 17. The veteran right-hander struck out a season-high eight and walked one.

Hendricks, who lost his spot in the rotation after struggling early in the season, didn’t allow a hit until Thairo Estrada doubled to left leading off the sixth. Estrada moved up on a bunt single by Brett Wisely and scored on Heliot Ramos’ fielder’s-choice grounder.

Hendricks walked off to loud cheers before Drew Smyly struck out Chapman.

Erik Miller struck out two in a scoreless first inning as the opener in a bullpen game for San Francisco.

TRAINER'S ROOM

Giants: The Giants were trying to decide the next step for LHP Blake Snell (strained left groin) after the two-time Cy Young Award winner threw a bullpen session Tuesday in San Francisco. "It's going to be some kind of a game, I'm not sure what," manager Bob Melvin said.

UP NEXT

Giants: The Giants had not announced a starter for Thursday's Negro League tribute game honoring Mays against St. Louis at Rickwood Field in Birmingham, Alabama. RHP Andre Pallante (2-3, 4.61 ERA) pitches for St. Louis.

Cubs: LHP Shota Imanaga (7-1, 1.89) is set to start Friday, when the Cubs open a weekend series against the Mets. LHP Jose Quintana (2-5, 4.98) pitches for New York.

Related

Cubs place OF Mike Tauchman on IL, recall INF Miles Mastrobuoni from Triple-A

The Chicago Cubs placed outfielder Mike Tauchman on the 10-day injured list with a left groin strain before Tuesday's game with the San Francisco Giants.