Donovan Solano hit a two-run, go-ahead homer in the sixth inning and the San Francisco Giants beat the Arizona Diamondbacks 4-2 on Sunday.

Brandon Belt and Chadwick Tromp also went deep for the Giants, who improved to 7-2 against the Diamondbacks this season.

Solano, who got off to a scorching start at the plate this season, came in hitting just .216 over his past 12 games. But he went 3-for-3 Sunday with a double and single to go along with his third homer.

San Francisco Giants' Wilmer Flores, bottom right, hits a double in front of Arizona Diamondbacks catcher Stephen Vogt during the sixth inning of a baseball game in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

San Francisco Giants' Wilmer Flores, bottom right, hits a double in front of Arizona Diamondbacks catcher Stephen Vogt during the sixth inning of a baseball game in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

He hit the first pitch he saw from Alex Young (1-3) in the sixth for a two-run shot to left that erased a 2-1 San Francisco deficit.

Belt came off the bench to deliver a pinch-hit solo shot in the seventh to extend San Francisco’s lead to 4-2 and continue his torrid streak at the plate.

He’s hitting .491 (27 for 55) over his past 18 games.

Arizona Diamondbacks' Josh Rojas reacts after striking out against the San Francisco Giants during the eighth inning of a baseball game in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

Arizona Diamondbacks' Josh Rojas reacts after striking out against the San Francisco Giants during the eighth inning of a baseball game in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

Tromp, drawing the start behind the plate, homered in the third to cut the Giants’ deficit to 2-1.

San Francisico starter Johnny Cueto steadied himself after a shaky first inning and held the Diamondbacks to two runs over 5 2/3 innings. Both runs came in the first, including Tim Locastro’s homer to lead off the game.

Arizona advanced a runner as far as third base in just two other innings after the first.

San Francisco Giants' Austin Slater, right, kneels during the national anthem before a baseball game between the Giants and the Arizona Diamondbacks in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

San Francisco Giants' Austin Slater, right, kneels during the national anthem before a baseball game between the Giants and the Arizona Diamondbacks in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

San Francisco’s bullpen turned in terrific work in support of Cueto, as Caleb Barager (5-1), Jarlin Garcia, Tony Watson bridged the gap to Tyler Rogers, who notched the save.

ROSTER MOVES

Arizona recalled INF Wyatt Mathisen from its alternate training site and optioned RHP Artie Lewicki. It’s the first major league call-up for Mathisen, 26. … San Francisco recalled RHP Rico Garcia from its alternate training site and optioned LHP Andrew Suarez.

San Francisco Giants' Darin Ruf catches a fly out hit by Arizona Diamondbacks' Jon Jay during the sixth inning of a baseball game in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

San Francisco Giants' Darin Ruf catches a fly out hit by Arizona Diamondbacks' Jon Jay during the sixth inning of a baseball game in San Francisco, Sunday, Sept. 6, 2020. (AP PhotoJeff Chiu)

TRAINER’S ROOM

Diamondbacks: LHP Caleb Smith, scratched from an outing Saturday at Arizona’s alternate training site because of mid-body soreness, threw in a game Sunday instead.

Giants: LHP Drew Smyly (sprained left index finger) and RHP Jeff Samardzija (inflammation in pitching shoulder) both came out of Saturday’s simulated games feeling OK. Manager Gabe Kapler said Samardzija could be brought back as a starter or a long reliever.

UP NEXT

Zac Gallen (1-0, 1.80 ERA) starts Monday’s series finale and will look to extend his Major League record streak of 23 games to start a career with three or fewer earned runs allowed (all starts). The Giants’ Kevin Gausman (2-2, 4.43 ERA) has won two of his past three starts.

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