The Chicago Cubs ended a 108-year World Series title drought in the most dramatic of ways. By early Thursday morning, the sound of victory poured into the streets of Chicago as fans celebrated the Cubs beating the Cleveland Indians, 8-7, in a 10-inning Game 7 classic. Sheer joy was often mixed with utter disbelief: The Chicago Cubs are finally World Series champions. And “Parks and Recreation” might have known it all along.

There was a time not long ago when the thought of Wednesday night’s scene was unfathomable for many of the team’s supporters. For years, the Cubs had not given even the most die-hard fans reason to believe anything would change after decades of misery, close calls and the oft-mentioned curse.

“Parks and Recreation” co-creator Michael Schur was not one of those people. Schur, a lifelong baseball fan and avid Boston Red Sox supporter, personally wrote a line into the final season of his NBC sitcom, which wrapped in 2015, predicting that the Cubs would win the 2016 World Series.

As recently as January of last year, Schur’s prediction was met with laughter during a press stop. The Cubs were, after all, just a few months removed from an 89-loss season.

“It’s one of those things where until it happens, it seems impossible,” Schur said in a phone interview with The Post last week as the World Series was about to begin. “But that’s what makes [Cubs President of Baseball Operations] Theo Epstein amazing. He puts together these teams [the 2004 Red Sox and the 2016 Cubs] and after it happens, you’re like, ‘Oh, it was inevitable. They were just the best team.’ ”

In the episode “Ron and Jammy,” which was written six months before it aired in early 2015, some of the characters visit Chicago in the summer of 2017, and the city is still basking in the Cubs’ recent World Series victory. Schur said he believed that the Cubs were on track to win it all from the moment Epstein joined the Cubs in 2011 and has been a fan of his ever since Epstein helped Boston end its own World Series championship drought in 2004.

“As soon as we decided to throw the last season of ‘Parks and Rec’ into the future, into 2017, we sort of started calculating what the world might be like,” Schur said. “We talked about . . . aspects of America that we could sort of casually mention that we thought would be funny.

“I was the only person on the staff who cared about baseball enough to track the Cubs’ minor league system,” he added with a laugh.

Schur is no casual MLB observer. His baseball insight has been featured on Grantland and NBC Sports, and the 41-year-old Connecticut native was one of the founders of the baseball blog Fire Joe Morgan.

Going into the World Series, Schur predicted that the Cubs would win in five games — although he said “that’s mostly because of” the song “Cubs in Five” by the indie band The Mountain Goats — and said “it’s going to be awesome” for the fans, including “Parks and Recreation” actor and Cubs supporter Nick Offerman (also known as Ron Swanson).

Yet Schur is hesitant to take credit for his foresight, no matter how much other people try.

“It’s not like I was only person who thought the Cubs were going to be good,” he said. “Every baseball writer in America knew the Cubs were going to be good. I can’t emphasize enough how little credit I feel like I should take for that prediction. It’s a little like, if we had predicted [in the show] that Hillary Clinton was the president in 2017, there would probably be people asking me about that now. Saying Hillary Clinton was running for president in 2014 or 2013 . . . that would’ve also been a pretty easy call to make based on the information that we had at the time. We’re not like wizards.”

This post was originally published on Oct. 25 and has since been updated with the Cubs’ World Series victory.