Merrill Kelly pitched seven effective innings, Ketel Marte had two hits and the Arizona Diamondbacks snapped a 17-game losing streak by beating the Milwaukee Brewers 5-1 on Monday night.

The win was a long time coming for Arizona, which has plunged to the bottom of the standings in the NL West and has the worst record in the majors at 21-53. It was the first win for the Diamondbacks since they beat the Mets 6-5 in 10 innings on June.

More Images
Umpire D.J. Reyburn (17) examines the glove and cap of Milwaukee Brewers starter Brett Anderson, right, as the pitcher leaves a baseball game due to injury during the second inning against the Arizona Diamondbacks, Monday, June 21, 2021, in Phoenix. Beginning Monday, Major League Baseball will enhance its enforcement of rules that prohibit applying foreign substances to baseballs. (AP PhotoRoss D. Franklin)

Merrill Kelly pitched seven effective innings, Ketel Marte had two hits and the Arizona Diamondbacks snapped a 17-game losing streak by beating the Milwaukee Brewers 5-1 on Monday night.

Arizona Diamondbacks' Stephen Vogt watches his run-scoring single get through to the infield during the second inning of a baseball game against the Milwaukee Brewers' Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Kelly (3-7) — the only Diamondbacks starting pitcher who has stayed reasonably healthy all season — had one of his best outings of the year. The right-hander needed just 94 pitches to navigate his seven innings, giving up one run, five hits and a walk with five strikeouts.

Arizona Diamondbacks' Nick Ahmed (13) celebrates his run scored against the Milwaukee Brewers with teammate Asdrubal Cabrera, left, and manager Torey Lovullo, right, during the second inning of a baseball game Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Joakim Soria worked the ninth to end three weeks of misery for the Diamondbacks. When the last out was recorded, catcher Stephen Vogt did a little dance and a relieved group of D-backs shared smiles and handshakes.

Arizona Diamondbacks' Merrill Kelly backs away from a bunt attempt as Milwaukee Brewers catcher Omar Narvaez, left, reaches out for the inside pitch during the second inning of a baseball game Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

EARLY EXIT

Milwaukee Brewers relief pitcher Trevor Richards, right, turns his belt around as umpires D.J. Reyburn, left, and Brian O'Nora, center, examine his belt, glove and cap during the second inning of a baseball game against the Arizona Diamondbacks, Monday, June 21, 2021, in Phoenix. Beginning Monday, Major League Baseball will enhance its enforcement of rules that prohibit applying foreign substances to baseballs. (AP PhotoRoss D. Franklin)

Brewers: RHP Zack Godley was designated for assignment after making two appearances. He gave up six earned runs over 3 1/3 innings. RHP Jake Cousins' contract was selected from Triple-A Nashville.

The 17-game skid was two shy of the longest during the wild-card era, by the Kansas City Royals in 2005.

Umpire D.J. Reyburn (17) examines the glove and cap of Milwaukee Brewers starter Brett Anderson, right, as the pitcher leaves a baseball game due to injury during the second inning against the Arizona Diamondbacks, Monday, June 21, 2021, in Phoenix. Beginning Monday, Major League Baseball will enhance its enforcement of rules that prohibit applying foreign substances to baseballs. (AP PhotoRoss D. Franklin)

Umpire D.J. Reyburn (17) examines the glove and cap of Milwaukee Brewers starter Brett Anderson, right, as the pitcher leaves a baseball game due to injury during the second inning against the Arizona Diamondbacks, Monday, June 21, 2021, in Phoenix. Beginning Monday, Major League Baseball will enhance its enforcement of rules that prohibit applying foreign substances to baseballs. (AP PhotoRoss D. Franklin)

Kelly (3-7) — the only Diamondbacks starting pitcher who has stayed reasonably healthy all season — had one of his best outings of the year. The right-hander needed just 94 pitches to navigate his seven innings, giving up one run, five hits and a walk with five strikeouts.

The night didn't start well for the D-backs, who fell behind in the first inning after Milwaukee's Avisail Garcia lined a two-out RBI single through the infield.

Arizona with three runs in the second, when seven straight batters reached base on six singles and one walk. The D-backs pushed ahead 5-1 in the fourth after Josh Rojas sliced an opposite-field RBI double to left and Marte scored on a groundout.

Arizona Diamondbacks' Stephen Vogt watches his run-scoring single get through to the infield during the second inning of a baseball game against the Milwaukee Brewers' Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Arizona Diamondbacks' Stephen Vogt watches his run-scoring single get through to the infield during the second inning of a baseball game against the Milwaukee Brewers' Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Joakim Soria worked the ninth to end three weeks of misery for the Diamondbacks. When the last out was recorded, catcher Stephen Vogt did a little dance and a relieved group of D-backs shared smiles and handshakes.

The Diamondbacks started the season with a 15-13 record but have had a rough time for nearly two months. Even with Monday's win, they're just 6-40 since May 2. They've also got one more dubious losing streak to end: They've dropped 23 straight games on the road, the longest skid in modern-day MLB history.

Arizona's next chance to end that streak is on Friday in San Diego.

Arizona Diamondbacks' Nick Ahmed (13) celebrates his run scored against the Milwaukee Brewers with teammate Asdrubal Cabrera, left, and manager Torey Lovullo, right, during the second inning of a baseball game Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Arizona Diamondbacks' Nick Ahmed (13) celebrates his run scored against the Milwaukee Brewers with teammate Asdrubal Cabrera, left, and manager Torey Lovullo, right, during the second inning of a baseball game Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

EARLY EXIT

Milwaukee starting pitcher Brett Anderson (2-5) left in the second inning because of right knee discomfort. Anderson had given up five straight hits before the injury. He gave up three earned runs over 1 1/3 innings.

ROSTER MOVES

Arizona Diamondbacks' Merrill Kelly backs away from a bunt attempt as Milwaukee Brewers catcher Omar Narvaez, left, reaches out for the inside pitch during the second inning of a baseball game Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Arizona Diamondbacks' Merrill Kelly backs away from a bunt attempt as Milwaukee Brewers catcher Omar Narvaez, left, reaches out for the inside pitch during the second inning of a baseball game Monday, June 21, 2021, in Phoenix. (AP PhotoRoss D. Franklin)

Brewers: RHP Zack Godley was designated for assignment after making two appearances. He gave up six earned runs over 3 1/3 innings. RHP Jake Cousins' contract was selected from Triple-A Nashville.

Diamondbacks: Placed RHP Matt Peacock on the bereavement list. RHP Humberto Castellanos was recalled from Triple-A Reno to take his place.

TRAINER'S ROOM

Milwaukee Brewers relief pitcher Trevor Richards, right, turns his belt around as umpires D.J. Reyburn, left, and Brian O'Nora, center, examine his belt, glove and cap during the second inning of a baseball game against the Arizona Diamondbacks, Monday, June 21, 2021, in Phoenix. Beginning Monday, Major League Baseball will enhance its enforcement of rules that prohibit applying foreign substances to baseballs. (AP PhotoRoss D. Franklin)

Milwaukee Brewers relief pitcher Trevor Richards, right, turns his belt around as umpires D.J. Reyburn, left, and Brian O'Nora, center, examine his belt, glove and cap during the second inning of a baseball game against the Arizona Diamondbacks, Monday, June 21, 2021, in Phoenix. Beginning Monday, Major League Baseball will enhance its enforcement of rules that prohibit applying foreign substances to baseballs. (AP PhotoRoss D. Franklin)

Diamondbacks: INF Eduardo Escobar has a strain in his right quadriceps and didn't start on Monday. Manager Torey Lovullo said he was available off the bench. ... C Carson Kelly (fractured right wrist) will head to the team's training site in Scottsdale to begin treatment. Lovullo said there was no timetable for his return. ... LHP Madison Bumgarner (shoulder inflammation) threw a 20-pitch bullpen on Monday. ... RHP J.B. Bukaskas (elbow strain) and RHP Taylor Widener (groin strain) will throw batting practice on Tuesday.

UP NEXT

The Diamondbacks will send RHP Zac Gallen (1-2, 3.99 ERA) to the mound to face Brewers RHP Freddy Peralta (6-2, 2.28) on Tuesday night. It is Gallen's second start since returning from the injured list with a strained elbow.

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