On Tuesday night, Austin Riley broke out of a slump with a two-homer, seven-RBI night. It wasn’t enough, as the Braves lost 16-13.

He homered again Wednesday. Again, the Braves lost, 5-3.

He continued his hot stretch Thursday. This time, it was enough. Riley hit a go-ahead three-run home run in the eighth inning, sparking the Braves to a 7-5 victory and snapping a four-game losing streak.

Kirby Yates got the win in relief. Raisel Iglesias pitched a clean ninth inning for his 17th save.

The first six innings were a pitcher’s duel. Zac Gallen and Spencer Strider traded zeroes, looking like the All-Stars and Cy Young candidates they are. At one point, Strider struck out six Diamondbacks in a row. Gallen was better, throwing five perfect innings.

The Diamondbacks’ ace blinked first. Orlando Arcia homered with one out in the sixth inning, his ninth home run of the season. It could have been more, but Michael Harris II was picked off trying to time up Gallen’s delivery.

Strider struggled with the lead. He walked the leadoff man, then hit Christian Walker. Diamondbacks designated hitter Dominic Canzone then hit a three-run home run to right field to take the lead. Third baseman Emmanuel Rivera followed with a solo shot of his own. Right fielder Corbin Carroll added an insurance run in the eighth.

The Braves roared back in the bottom half. Harris started the inning with a double, and after Ozzie Albies walked, Riley took the lead with a 432-foot blast. Olson followed with a solo shot, his second of the game. The homers proved enough to prevent the Braves’ first five-game skid since 2017.

Strider pitched six innings, giving up four runs on four hits. He struck out 13.

The Braves will begin a three-game set Friday night (8:20 ET) in Milwaukee. Michael Soroka (1-1, 5.40 ERA) will start against the Brewers’ Freddy Peralta (6-7, 4.41).