The Baseball Tonight crew breaks down what got the Cubs to the postseason earlier than expected. (1:34)

The Chicago Cubs have clinched a playoff spot for the first time since 2008.

The Cubs were assured of at least an NL wild-card slot Friday night when San Francisco lost to Oakland 5-4, eliminating the Giants from playoff contention.

Wrigley Field might have been dark Friday night, but the marquee lit up with the news that the Cubs were back in the postseason. AP Photo/Paul Beaty

The sign outside Wrigley Field lit up with "Cubs Clinch Postseason Berth'' after it became official late Friday night. Fans gathered around to take pictures and mark Chicago's return for the first time since 2008.

First-year manager Joe Maddon and the Cubs missed a chance to seal a playoff berth much earlier in the day when they lost to Pittsburgh 3-2 at Wrigley Field.

With a 1:05 p.m. ET start Saturday, Maddon said the only way he would check the Giants-A's score was "probably when I get up to go to the bathroom at night."

Pitcher Jake Arrieta stayed awake.

It's official. Playoffs. Now we go. — Jake Arrieta (@JArrieta34) September 26, 2015

The road back to the playoffs was a long one for the Cubs, who endured five straight losing seasons and a painful top-to-bottom overhaul under Theo Epstein.

He began loading up the minor league system almost as soon as he was hired as the team's president of baseball operations in October 2011, and it paid off in a big way.

Young players started to make their way to the majors last season. The Cubs then made it clear they were serious about winning when they hired Maddon and signed Jon Lester in the offseason.

Kris Bryant, who had two hits and scored Friday, made his debut this season, as did Kyle Schwarber. Both players made big impacts.

"We'll hopefully celebrate tomorrow and have a good time," said Lester, who like Maddon was not planning to stay up. "These guys have never experienced this. We'll enjoy it."

On Friday, the Pirates hung on for their seventh straight win and increased their lead for the NL's top wild card to 4½ games over the Cubs.

Chicago trails NL Central-leading St. Louis by 7½ games with nine games left.

The Cubs haven't won a playoff game since the 2003 NL Championship Series. They were swept 3-0 in the NL Division Series in 2007 and 2008.

The Associated Press contributed to this report.