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.

More Images
Texas Rangers' Joey Gallo, right, celebrates with Shin-Soo Choo (17) after hitring a three run home run off San Francisco Giants' Tyler Anderson in the seventh inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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.

San Francisco Giants' Chadwick Tromp, right, waves at third base coach Ron Wotus (23) after hitting a two run home run against the Texas Rangers in the sixth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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

San Francisco Giants' Jeff Samardzija, right, hands the ball to manager Gabe Kapler as he is removed in the sixth inning of a baseball game against the Texas Rangers Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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

San Francisco Giants pitcher Jeff Samardzija works against the Texas Rangers in the first inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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.

Texas Rangers pitcher Kolby Allard works against the San Francisco Giants during the first inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Hamilton signed with the Giant in the offseason but was not on the team’s opening day roster.

Texas Rangers' Shin-Soo Choo, right, celebrates with Isiah Kiner-Falefa (9) after hitting a two run home run off San Francisco Giants' Jeff Samardzija in the fifth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Triggs was called up from the Alternate Training Site before the game. RHP Jandel Gustave was designated for assigment.

Texas Rangers' Shin-Soo Choo watches his two run home run hit off San Francisco Giants' Jeff Samardzija in the fifth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

TRAINER’S ROOM

San Francisco Giants' Chadwick Tromp celebrates as he crosses home plate after hitting a two run home run against the Texas Rangers in the sixth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

UP NEXT

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.

Texas Rangers' Joey Gallo, right, celebrates with Shin-Soo Choo (17) after hitring a three run home run off San Francisco Giants' Tyler Anderson in the seventh inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Texas Rangers' Joey Gallo, right, celebrates with Shin-Soo Choo (17) after hitring a three run home run off San Francisco Giants' Tyler Anderson in the seventh inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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.

San Francisco Giants' Chadwick Tromp, right, waves at third base coach Ron Wotus (23) after hitting a two run home run against the Texas Rangers in the sixth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

San Francisco Giants' Chadwick Tromp, right, waves at third base coach Ron Wotus (23) after hitting a two run home run against the Texas Rangers in the sixth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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.

San Francisco Giants' Jeff Samardzija, right, hands the ball to manager Gabe Kapler as he is removed in the sixth inning of a baseball game against the Texas Rangers Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

San Francisco Giants' Jeff Samardzija, right, hands the ball to manager Gabe Kapler as he is removed in the sixth inning of a baseball game against the Texas Rangers Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

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.

GIANTS SEND HAMILTON TO METS

The Giants traded outfielder Billy Hamilton to the Mets in exchange for right-hander Jordan Humphreys. Humpheys was immediately optioned to San Francisco’s Alternate Training Site.

San Francisco Giants pitcher Jeff Samardzija works against the Texas Rangers in the first inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

San Francisco Giants pitcher Jeff Samardzija works against the Texas Rangers in the first inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Hamilton signed with the Giant in the offseason but was not on the team’s opening day roster.

“We recognize the value of having extra bats and extra arms in the (bullpen), and that just kind of made Hamilton a tougher fit, particularly with us going down to a 28-man roster size later this week,” manager Gabe Kapler said.

ROSTER MOVES

Texas Rangers pitcher Kolby Allard works against the San Francisco Giants during the first inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Texas Rangers pitcher Kolby Allard works against the San Francisco Giants during the first inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Triggs was called up from the Alternate Training Site before the game. RHP Jandel Gustave was designated for assigment.

Texas called up infielder Anderson Tejeda.

QUOTABLE

“It will get better. It will improve. I just think 2020 was meant to kind of test us all, especially right now. It’s just another test that we’re going to have to get through.” – Rangers manager Chris Woodward

Texas Rangers' Shin-Soo Choo, right, celebrates with Isiah Kiner-Falefa (9) after hitting a two run home run off San Francisco Giants' Jeff Samardzija in the fifth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Texas Rangers' Shin-Soo Choo, right, celebrates with Isiah Kiner-Falefa (9) after hitting a two run home run off San Francisco Giants' Jeff Samardzija in the fifth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

TRAINER’S ROOM

Rangers: Woodward is hopeful that 2B Rougned Odor will be available for Tuesday’s game in Oakland. Odor left Saturday’s game with tightness in the oblique area on his right side. … OF Danny Santana was placed on the 10-day injured list with a right forearm strain. Santana is 1 for 17 and has not played since Tuesday.

Giants: LHP Drew Smyly was placed on the 10-day injured list with a left index finger strain. Smyly had seven strikeouts in four innings Saturday before leaving because of discomfort in the finger.

Texas Rangers' Shin-Soo Choo watches his two run home run hit off San Francisco Giants' Jeff Samardzija in the fifth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

Texas Rangers' Shin-Soo Choo watches his two run home run hit off San Francisco Giants' Jeff Samardzija in the fifth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

UP NEXT

Rangers: Texas will remain in the Bay Area and begin a three-game series at Oakland on Tuesday. LHP Lance Lynn (1-0, 0.00) starts the opener. Texas won in both of Lynn’s previous two starts this season.

Giants: No starter has been announced for Monday’s game in Colorado.

San Francisco Giants' Chadwick Tromp celebrates as he crosses home plate after hitting a two run home run against the Texas Rangers in the sixth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

San Francisco Giants' Chadwick Tromp celebrates as he crosses home plate after hitting a two run home run against the Texas Rangers in the sixth inning of a baseball game Sunday, Aug. 2, 2020, in San Francisco. (AP PhotoBen Margot)

More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP_Sports