MILWAUKEE (AP) — The Milwaukee Brewers were on the verge of going down in order in the eighth when a stroke of luck kept the inning going.

Given new life, the Brewers broke out of their collective hitting slump and snapped the St. Louis Cardinals’ four-game winning streak.

Travis Shaw hit a tiebreaking double and Avisaíl García added a two-run homer in the eighth as the Brewers defeated the Cardinals 4-1 on Wednesday night. That outburst was possible only because a wild pitch foiled Ryan Helsey’s apparent inning-ending strikeout of Daniel Vogelbach.

“The rally started in a pretty strange way with the strikeout and just getting a base,” Brewers manager Craig Counsell said. “That was probably the big break. Then we put two great swings on baseballs — drove a ball in the gap and hit a ball over the fence. That was the good stuff.”

After Vogelbach reached first, Shaw hit a double to right center off Helsley (3-1) that brought home pinch-runner Pablo Reyes. García capped the outburst with a towering homer to left-center that was projected at 442 feet.

The Brewers gained a measure of revenge after losing 6-1 to the NL Central-leading Cardinals in 11 innings a night earlier. The Cardinals came from behind to win Tuesday despite getting just two hits in the first 10 innings.

“It seems like any time we play them, it’s always close like this,” Shaw said. “There’s going to be some back and forth. We’re going to have nights that get away from us like last night. And then we’re going to have our nights like we had tonight.”

The Cardinals had tied the game in the top of the eighth on Tyler O’Neill’s homer to right off Brandon Woodruff, who struck out 10 and gave up just three hits and one walk in 7 2/3 splendid innings.

Woodruff, who has a 1.19 ERA over his last seven starts, carried a no-hitter into the sixth.

Devin Williams (1-0) retired Tommy Edman on a grounder with a runner on first to make sure the Cardinals did no more damage in the eighth.

The Cardinals brought the potential tying run to the plate with one out in the ninth after Paul Goldschmidt doubled and Nolan Arenado walked, but Josh Hader retired Edmundo Sosa on a fielder’s choice and struck out Yadier Molina to earn his eighth save.

Milwaukee’s eighth-inning rally was a fitting climax on a night when the Brewers found creative ways to score runs. That was most apparent in the sixth inning as Milwaukee broke a scoreless tie.

With runners on first and second, Shaw greeted reliever Genesis Cabrera with a deep fly to center. Center fielder Harrison Bader fell down, but somehow managed to make the catch while on his side in the warning-track dirt.

“The grass, sod or whatever you say, right where it meets the track, just totally gave out,” Bader said. “Pretty frustrating, yeah.”

As Bader tried to get the ball out of his glove, the ball instead rolled past him and headed toward the wall, forcing him to go back to retrieve it.

Lorenzo Cain took off from second and came all the way home as his headfirst slide easily beat the throw to the plate. The play was scored a flyout with Cain coming home on Bader’s error.

“Lorenzo, on the bases, he sees everything,” Counsell said. “He really does.”

TRAINER’S ROOM

Cardinals: SS Paul DeJong left in the fifth inning with left side tightness. Manager Mike Shildt said DeJong will undergo an MRI. … Shildt said LHP Andrew Miller (right foot/toe blister) threw a 25-pitch bullpen session Tuesday. … RHP Miles Mikolas (shoulder) struck out five and gave up three runs, five hits and no walks Tuesday in a four-inning rehabilitation appearance for the Cardinals’ Triple-A Memphis affiliate.

Brewers: RHP Corbin Burnes said Wednesday that a positive test for the coronavirus last month caused him to go on the injured list, but added he was asymptomatic the entire time. Burnes is expected to be activated in time to pitch Thursday. … García returned to the starting lineup for the first time since Saturday after dealing with a back issue. He made pinch-hitting appearances Sunday and Tuesday.

UP NEXT

Burnes (2-2, 1.53 ERA) returns from the injured list to match up with St. Louis RHP Jack Flaherty (6-0, 2.83) as the three-game series concludes Thursday afternoon.