Will Smith’s pinch-hit sacrifice fly with the bases loaded in the seventh inning scored the tying and go-ahead runs when Josh Rojas committed an error in right field, and the Los Angeles Dodgers rallied to beat the Arizona Diamondbacks 4-2 on Wednesday night.

Mookie Betts followed with a ground-rule double after going hitless in his first three at-bats as the Dodgers capitalized on two walks and a glaring miscue by the Diamondbacks to take a 4-2 lead.

More Images
Los Angeles Dodgers' Will Smith heads to first on a sacrifice fly during the seventh inning of a baseball game against the Arizona Diamondbacks on Wednesday, May 19, 2021, in Los Angeles. Right fielder Josh Rojas was charged with an error on the play. Two runs scored, and Smith was safe at first. (AP PhotoMarcio Jose Sanchez)

Will Smith’s pinch-hit sacrifice fly with the bases loaded in the seventh inning scored the tying and go-ahead runs when Josh Rojas committed an error in right field, and the Los Angeles Dodgers rallied to beat the Arizona Diamondbacks 4-2 on Wednesday night.

Los Angeles Dodgers second baseman Chris Taylor, top, prepares to tag out Arizona Diamondbacks' David Peralta on a steal attempt during the fourth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Joe Kelly (1-0) retired the side in the seventh to earn the win. Kenley Jansen worked the ninth for his ninth save.

Arizona Diamondbacks' Eduardo Escobar, right, celebrates his two-run home run with Andrew Young (15) and Josh Rojas (10) during the fourth inning of the team's baseball game against the Los Angeles Dodgers on Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Yoshi Tsutsugo's opposite-field single in the fourth scored the Dodgers' first run, giving him his first RBI with the team since being acquired from Tampa Bay last weekend.

Los Angeles Dodgers starting pitcher Clayton Kershaw throws to first to keep an Arizona Diamondbacks runner close to the bag, during the first inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Peacock quieted the World Series champion Dodgers in his second major league start. The right-hander gave up one run and four hits in 5 1/3 innings. He struck out four and walked none. Peacock retired his first 10 batters.

Arizona Diamondbacks starting pitcher Matt Peacock throws to a Los Angeles Dodgers batter during the first inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

UP NEXT

Arizona Diamondbacks manager Torey Lovullo, right, is thrown out of the game by home plate umpire Will Little after Lovullo argued a ruling following a ground ball by Matt Peacock to Los Angeles Dodgers starting pitcher Clayton Kershaw during the fifth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Arizona Diamondbacks manager Torey Lovullo, right, is thrown out of the game by home plate umpire Will Little after Lovullo argued a ruling following a ground ball by Matt Peacock to Los Angeles Dodgers starting pitcher Clayton Kershaw during the fifth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Arizona has been outscored 16-4 in losing the first three games of the series. The Diamondbacks dropped their fourth in a row overall and ninth straight on the road after manager Torey Lovullo was ejected in the fifth. He argued a call of runner interference on pitcher Matt Peacock, who bunted and ran inside the line going to first before getting hit in the back of his left leg by Clayton Kershaw's throw.

Los Angeles Dodgers' Will Smith heads to first on a sacrifice fly during the seventh inning of a baseball game against the Arizona Diamondbacks on Wednesday, May 19, 2021, in Los Angeles. Right fielder Josh Rojas was charged with an error on the play. Two runs scored, and Smith was safe at first. (AP PhotoMarcio Jose Sanchez)

Los Angeles Dodgers' Will Smith heads to first on a sacrifice fly during the seventh inning of a baseball game against the Arizona Diamondbacks on Wednesday, May 19, 2021, in Los Angeles. Right fielder Josh Rojas was charged with an error on the play. Two runs scored, and Smith was safe at first. (AP PhotoMarcio Jose Sanchez)

Joe Kelly (1-0) retired the side in the seventh to earn the win. Kenley Jansen worked the ninth for his ninth save.

Arizona opened the bottom of the seventh by issuing back-to-back walks, including one by Joe Mantiply (0-1) to Gavin Lux that put two runners on. Pinch-hitter Albert Pujols' single to right field went off the glove of Rojas, who had his back to the infield trying to make an over-the-shoulder catch. Instead, the play loaded the bases.

After Austin Barnes struck out, Smith's sac fly scored Taylor and Lux as Smith reached on Rojas' error that sent Pujols to second. Betts' ground-rule double to center made it 4-2, scoring DJ Peters, who ran for Pujols,

Los Angeles Dodgers second baseman Chris Taylor, top, prepares to tag out Arizona Diamondbacks' David Peralta on a steal attempt during the fourth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Los Angeles Dodgers second baseman Chris Taylor, top, prepares to tag out Arizona Diamondbacks' David Peralta on a steal attempt during the fourth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Yoshi Tsutsugo's opposite-field single in the fourth scored the Dodgers' first run, giving him his first RBI with the team since being acquired from Tampa Bay last weekend.

Arizona led 2-0 on Eduardo Escobar's two-run homer in the fourth off Kershaw.

The left-hander allowed two runs and two hits in six innings. He struck out eight and walked one.

Arizona Diamondbacks' Eduardo Escobar, right, celebrates his two-run home run with Andrew Young (15) and Josh Rojas (10) during the fourth inning of the team's baseball game against the Los Angeles Dodgers on Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Arizona Diamondbacks' Eduardo Escobar, right, celebrates his two-run home run with Andrew Young (15) and Josh Rojas (10) during the fourth inning of the team's baseball game against the Los Angeles Dodgers on Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Peacock quieted the World Series champion Dodgers in his second major league start. The right-hander gave up one run and four hits in 5 1/3 innings. He struck out four and walked none. Peacock retired his first 10 batters.

TRAINER'S ROOM

Diamondbacks: Reinstated INF-OF Ketel Marte (right hamstring strain) from the injured list. He pinch-hit in the eighth. ... LHP Madison Bumgarner, who left Monday's start because of a left adductor spasm, will throw a bullpen Thursday. “He feels fantastic,” Lovullo said.

Los Angeles Dodgers starting pitcher Clayton Kershaw throws to first to keep an Arizona Diamondbacks runner close to the bag, during the first inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Los Angeles Dodgers starting pitcher Clayton Kershaw throws to first to keep an Arizona Diamondbacks runner close to the bag, during the first inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

UP NEXT

Both teams will go with bullpen games in Thursday's series finale.

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

Arizona Diamondbacks starting pitcher Matt Peacock throws to a Los Angeles Dodgers batter during the first inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Arizona Diamondbacks starting pitcher Matt Peacock throws to a Los Angeles Dodgers batter during the first inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Arizona Diamondbacks manager Torey Lovullo, right, is thrown out of the game by home plate umpire Will Little after Lovullo argued a ruling following a ground ball by Matt Peacock to Los Angeles Dodgers starting pitcher Clayton Kershaw during the fifth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)

Arizona Diamondbacks manager Torey Lovullo, right, is thrown out of the game by home plate umpire Will Little after Lovullo argued a ruling following a ground ball by Matt Peacock to Los Angeles Dodgers starting pitcher Clayton Kershaw during the fifth inning of a baseball game Wednesday, May 19, 2021, in Los Angeles. (AP PhotoMarcio Jose Sanchez)