SAN FRANCISCO (AP) — Willie Calhoun hit a tiebreaking sacrifice fly after the Giants walked the bases loaded in the seventh inning, Joey Gallo followed with a three-run home run and the Texas Rangers beat San Francisco 9-5 on Sunday to avoid a three-game sweep.

Shin-Soo Choo also went deep for Texas. Scott Heineman had a pair of hits including a two-run double and Jeff Mathis added an RBI single.

Evan Longoria and Chadwick Tromp homered for San Francisco. Tromp’s was the first of his career, Hunter Pence tripled to snap a season-opening 0 for 23 funk.

The Rangers entered the day last in the AL in scoring and hits before getting season-highs in both against the Giants.

They got some help from San Francisco’s bullpen, too, when reliever Andrew Triggs (0-1) walked three consecutive batters on 14 pitches to open the seventh. After Calhoun’s sacrifice fly off Tyler Anderson made it 6-5, Gallo crushed an 0-2 pitch to right-center.

Gallo also singled, doubled and walked.

Jonathan Hernandez (2-0) retired six batters to win.

Choo pulled his second home run of the season over the right field wall into McCovey Cove off Giants starter Jeff Samardzija in the fifth. On Friday the Rangers leadoff batter hit an opposite field homer on the game’s first pitch.

Texas also got an encouraging outing from lefty Kolby Allard in his first start. Allard allowed one run and two hits before coming out after throwing 75 pitches in four innings.

Samardzija gave up five runs and seven hits in 5 2/3 innings and became the first Giants pitcher to make it through five innings.

(© Copyright 2020 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)