The Chicago Cubs snapped a historic drought on Saturday afternoon at Wrigley Field, defeating the Pittsburgh Pirates 3-1 behind a late rally and a strong outing from left-hander Shota Imanaga.

The victory was the Cubs’ first comeback win since July 2, ending a 35-game streak without one, the longest such stretch in franchise history dating back to 1876, according to team historian Ed Hartig, as noted by Jordan Bastian of MLB.com.

Chicago (69-53) had dropped four of its previous five games, including a 3-2 loss in Friday’s series opener, and had been searching for answers at the plate. That drought finally ended in the eighth inning. Kyle Tucker, batting just .140 across a dozen games this month entering Saturday, led off with a single against Pirates reliever Evan Sisk (0-1) and immediately stole second base.

Seiya Suzuki then delivered the go-ahead RBI with a single into center, putting the Cubs ahead 2-1. After Pete Crow-Armstrong advanced Suzuki with a sacrifice bunt and Ian Happ drew an intentional walk, Nico Hoerner added insurance with a two-out RBI double.

Earlier, the Cubs tied the game in the fourth when Tucker singled, moved to second on a walk by Crow-Armstrong, and scored on Carson Kelly’s base hit up the middle. That was the only damage done against Pittsburgh rookie Mike Burrows, who lasted five innings, allowing one run on five hits and two walks with four strikeouts over 68 pitches.

Imanaga once again anchored Chicago’s pitching staff. The lefty retired the first 10 Pirates batters he faced before Tommy Pham broke through with a 428-foot solo homer to left in the fourth inning, his sixth of the season.

That ended the Cubs’ 22-inning scoreless streak against Imanaga, but it was the only run Pittsburgh managed. Imanaga scattered three hits and two walks across seven innings, striking out six. His performance lowered Chicago’s rotation ERA to a Major League-best 3.04 since the All-Star break.

Pittsburgh (52-72) threatened multiple times but failed to capitalize. Jared Triolo went 2-for-4 and was the only Pirate with more than one hit. He doubled with two outs in the sixth, but Bryan Reynolds ended the inning with a flyout, and he reached third in the eighth, however, Reynolds stranded him again by striking out.

In the seventh, Joey Bart walked and reached third on Liover Peguero’s single, but Imanaga escaped by striking out Alexander Canario with a splitter.

After Imanaga’s seven strong innings, Andrew Kittredge (3-3) worked a scoreless eighth, and Brad Keller closed the door in the ninth for his first save. Keller struck out Andrew McCutchen, Bart, and pinch-hitter Spencer Horwitz in order after Nick Gonzales opened the inning with a single.

The Cubs’ offense remains inconsistent, with the team scoring three or fewer runs in 10 of 14 games this month, but Saturday’s late push not only secured a much-needed win, it also erased a franchise-record stretch of comeback futility.