PHOENIX (AP) Merrill Kelly threw seven solid innings, Pavin Smith and Josh Reddick homered and the Arizona Diamondbacks defeated the San Francisco Giants 5-3 on Thursday night.

Arizona snapped a four-game losing streak and ended its nine-game skid against the Giants.

Kelly (5-7) allowed three runs and seven hits, struck out seven and did not walk a batter. He has won his last three outings - the only three Diamondbacks wins over their past 27 games.

The right-hander stopped Arizona's 17-game slide with a victory over the Brewers and halted the club's major league-record 24-game road losing streak with a win against San Diego.

''Our job at the end of the day is to win,'' Kelly said. ''That is my goal going into every game regardless of if we are on a losing streak or winning streak. My job every day is to go as deep as I can and get us a win. I definitely take pride in it.''

Kelly also had an RBI single in the second for his second career hit, ending a hitless streak that lasted 44 at-bats dating back to 2019.

Diamondbacks reliever Joakim Soria put his first two batters on in the ninth but then got Donovan Solano to ground into a double play. Soria struck out Darin Ruf for his first save of the season.

Reddick had three hits, including his two-run homer. Arizona improved to 23-60, the worst record in the majors.

Johnny Cueto took the loss for San Francisco, which has dropped a season-high four straight. Cueto went five innings, allowing five runs and six hits. He walked two and struck out five.

Giants manager Gabe Kapler said Cueto was dealing with an illness during the start. Kapler added that Cueto ''gave us everything he had.''

''I thought he was able to make enough pitches to keep us in that baseball game,'' the manager said. ''The outing wasn't particularly crisp. I don't think he executed all his pitches but he made some. He was able to grind through five innings for us.''

San Francisco took a 3-2 lead in the fourth on Wilmer Flores' two-run homer, but the Diamondbacks quickly responded in the bottom half on Reddick's two-run shot that just cleared the right-field fence for his first long ball of the season.

''When he gets hot he can barrel up anybody,'' Diamondbacks manager Torey Lovullo said. ''I have seen these streaks from him before and it is fun to watch. He has great bat-to-ball skills. He is in a real good spot with some big hits.''

Smith added his sixth home run in the fifth, extending the lead to 5-3.

TRADING PLACES

The Diamondbacks acquired minor league RHP Keegan Curtis from the New York Yankees for speedy OF Tim Locastro.

The 29-year-old Locastro is a career .234 hitter but this season is batting only .178 with one homer and five steals in eight tries. He holds the record of most stolen bases without being caught to start a major league career with 29.

The 25-year-old Curtis has been pitching in Double-A this season. In four years in the minors, he has a career 3.29 ERA and 83 strikeouts in 65 2/3 innings.

TRAINER'S ROOM

Giants: OF Mike Tauchman (bruised right knee) was placed on the 10-day IL retroactive to June 30. . OF Jaylin Davis returned from his rehabilitation assignment and was reinstated from the 60-day injured list.

Diamondbacks: OF Kole Calhoun (hamstring) had a setback. He was playing for Triple-A Reno when he re-injured his left hamstring, the same one that required surgery in April. . Arizona reinstated RHP J.B. Bukauskas (right elbow flexor strain) from the 10-day injured list.

UP NEXT

The teams play the second game of their four-game set Friday, with the Giants sending LHP Alex Wood (6-3, 3.91 ERA) to the mound. RHP Zac Gallen (1-3, 3.69) will pitch for Arizona.

---

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports

Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.