Cubs book first playoff spot since 2008

Josh Harrison (R) of the Pittsburgh Pirates forces out Anthony Rizzo of the Chicago Cubs during the fourth inning, at Wrigley Field in Chicago, Illinois, on September 25, 2015 (AFP Photo/David Banks)

Chicago (AFP) - The Chicago Cubs clinched their first playoff berth since 2008 thanks to the San Francisco Giants 5-4 loss to the Oakland Athletics on Friday night.

The Cubs missed a chance to clinch on their own earlier in the day as they lost 3-2 to the Pittsburgh Pirates at Wrigley Field.

But it didn't matter as all Chicago needed to snap their lengthy playoff drought was to have the Giants lose. The Cubs are assured of at least a National League wild-card spot.

The Pirates moved 4 1/2 games ahead of the Cubs with eight regular season games to play in the regular season.

Pirates right-hander Gerrit Cole worked seven full innings for the win and closer Mark Melancon struggled before recording his 51st save.

The Cubs trail Central Division-leading St. Louis by 7 1/2 games with nine games left.

The Cubs haven't won a playoff game since the 2003 NL Championship Series and haven't won the World Series since 1908.