Community has done it, beating the odds and overcoming a cancellation to score a sixth-season order. After a couple of weeks of negotiations, series producer Sony Pictures TV has closed a deal with Yahoo for 13 new episodes to air this fall on Yahoo Screen. Talks went down to the wire as the options on the cast were set to expire today. Ever since NBC canceled Community last month, there had been interest from multiple outlets in continuing the cult comedy. I hear the list of possible suitors also included rebranded cable network Esquire; streaming service Hulu, which already has off-network rights to the series; and the Sony-owned Crackle.

Dan Harmon created Community and is returning as executive producer with Russ Krasnoff, Gary Foster and Chris McKenna. “I am very pleased that Community will be returning for its predestined sixth season on Yahoo,” Harmon said in the announcement of the deal. “I look forward to bringing our beloved NBC sitcom to a larger audience by moving it online. I vow to dominate our new competition. Rest easy, Big Bang Theory. Look out, Bang Bus!”

With its devoted following by a core group of passionate fans, Community is the type of show digital platforms crave. Complicating the series’ options was the fact that it has a digital syndication deal in place with Hulu, in addition to a cable off-network pact with Comedy Central.

“The fans spoke and we listened. Thanks to Yahoo, and the amazing team that makes Community great, we’ve avoided the Darkest Timeline yet again and plan to deliver a fantastic season,” said Zack Van Amburg, president of programming and production at SPT. Adds Jamie Erlicht, president of programming and production: “You can’t get to six seasons and a movie without a 6th season. Yahoo is the perfect home for the continuation of this journey.”

The deal for Community extends Sony TV’s strong track record in bringing back cancelled series. The studio previously brokered a deal to move acclaimed drama Damages to DirecTV after it was cancelled by FX, and found a way to bring back on their original networks cancelled series Drop Dead Diva on Lifetime and Unforgettable on CBS. All three series have gone to air multiple seasons post-cancellation.

What wasn’t immediately clear was how Yahoo plans to make money from continuing the cult show online. Reviving Arrested Development for another season, and bankrolling award-winning originals such as House Of Cards and Orange Is The New Black helped cement Netflix as a go-to place for all kinds of shows. Amazon is trying to follow a similar if not quite so high-profile path as it has been building up its Amazon Prime offerings. In both cases, the companies use the owned content to drive subscriptions, where they make their real money. Yahoo also has been investing aggressively in original content, signing deals with Katie Couric and former New York Times tech columnist David Pogue to create original programming that could draw in regular viewers. But unlike Netflix and Amazon, Yahoo has been betting on advertising to generate most of the revenues for its programming of all kinds.

“Yahoo is all about connecting the best creators to the audiences who love their work,” said Kathy Savitt, CMO of Yahoo. Community has an incredibly passionate and loyal fan base who have fought hard to keep this amazing show alive. We couldn’t be more excited to work with Dan, [star] Joel [McHale], and the entire cast, as well as Sony, to deliver a great Season 6.”

Sony TV’s efforts to revive Community had the blessing of Harmon, who confessed on his blog that he had warmed to the possibility of continuing the show elsewhere, changing his stance on finding a new home from “eh” when Sony TV called him with the news of the series’ cancellation by NBC to “sure, let’s talk” two days later. Said Harmon, “I’m not going to be the guy that re-cancels cancelled Community.”

Editor’s Note: Nellie Andreeva is on vacation.