Jonathan Banks, Joel McHale

NBC couldn't kill Community, even if it tried — and it definitely tried. But lengthy hiatuses and unusual scheduling (including Thanksgiving and Christmas episodes airing last spring) wouldn't destroy it. A controversial decision to replace creator Dan Harmon as showrunner last season couldn't slay it. Even all that Twitter chatter about "six seasons and a movie" didn't jinx it.

"Community is like a Twinkie," says Yvette Nicole Brown, who plays Shirley, perhaps the sweetest of the community-college study-group members who form the show's heart. "The shelf life of this show has defied odds."

The comedy doesn't get big ratings or tons of awards: A banner outside Stage 31 on the Paramount Studios lot in Hollywood, where it's filmed, reads, "congratulations — 0 emmy nominations!" But Community boasts plenty of critical acclaim and one of the most fervent fan bases in television.

Not only is that loyal audience part of the reason the show is back on Jan. 2 for a surprise fifth season, but it's also why — in an unprecedented move — Harmon was brought back to run the show (with fellow executive producer Chris McKenna, also returning from exile).

"A lot of us did not expect to get a fifth season," says Alison Brie, who plays innocent Annie. "By now we're so used to having the rug pulled up from under us."

Joel McHale, who stars as disgraced lawyer Jeff Winger, was instrumental in lobbying NBC and Sony (which produces Community) to bring back Harmon. "The show was in Dan's head," McHale says. "I think it can really only come from him."

The studio and network, which had clashed with Harmon over budgetary and creative issues, dropped him from the show in May 2012 while ordering a fourth season. "Nobody has had a conversation about what happened," Harmon says, "or why it unhappened."

He was replaced by Moses Port and David Guarascio (Just Shoot Me), who were apparently brought on to make Community more accessible. The duo had to be convinced to take the job, knowing it was a thankless endeavor. Many critics, who initially worried that the two might take the edge off Community, later took them to task for trying to emulate Harmon's voice.

"There was a whiteboard in the writers' room that had about 10 ideas we never got around to because they posed too difficult a creative challenge," Harmon says. "I was blown away to see [my replacements] were going down that list: doing an Inspector Spacetime convention; having Winger reconcile with his dad; the Pierce haunted house. It was a creative agenda I thought was the reason I got fired."

When Harmon was finally asked back, he felt he had no choice but to return. "If I did go back, the worst thing that could happen is a bad season of television," he says. "If I didn't go back, the worst thing that could happen is a lifetime of questions. I would have been miserable."

But in returning to Community, Harmon had to "not let the studio, network and the outside world get to me. I let it drive me crazy, and I let it inhibit the quality of my work," he says. "I knew coming into Season 5 that we were already off the schedule, and I had to wake up every morning at peace with the idea that no one might ever see what we were doing. It had to be about the craftsmanship. It had to be about making 13 episodes of television that I would love."

Although he's critical of how Port and Guarascio handled the show, Harmon admits he's grateful they didn't dramatically change the show's mythology, making it relatively easy to regroup from the two biggest changes at the end of Season 4: Winger graduating, which was in line with Harmon's plan, and haughty millionaire Pierce (Chevy Chase) leaving, a function of the actor wanting out.

Chase expressed much displeasure in the media about Community and the direction of his character. "You've read the 300 or 400 articles," McHale says. "The articles say he didn't like the writing and didn't like the show and didn't watch it and didn't want to be here. And now he's not."

In the season premiere (airing Thursday, Jan. 2 at 8/7c), it's months later, and the members of the group have moved on with their lives outside Greendale Community College. But when Winger comes up with a scheme to reunite the gang, they're willing to play along — despite Jeff's questionable motives. Making a subtle reference to Season 4, the characters joke of a "yearlong gas leak" that made them all act a bit differently.

With a clean slate, Harmon says he, McKenna and the writers decided to write an opener that fulfills the same function as a brand-new pilot. The episode, titled "Repilot," even contains callbacks to Community's first episode. "We needed to get back to basics," Harmon says, "and we needed to tell a satisfying story about someone coming back to community college, having not been in it."

McHale approves of the new direction. "It's all really rich and great," he says. "The scripts are so good. No matter what happens with the episodes, I know we're making good TV." His character eventually takes a job teaching at the school, which Harmon admits he had said Jeff would never do. "[It] seems like a jump-the-shark [moment]," he says, "so we needed to give him a reason to do it that resonated and allowed people to respect Jeff."

Danny Pudi, who plays socially awkward Abed, says the show has been energized: "It's been nice to go back to some of the things that we were exploring when the show began." Says Gillian Jacobs, who plays the flighty Britta, "We're still ambitious, we're still going for broke, but the heart of the show is really there, and the characters feel grounded."

Harmon has stressed the importance of spending more time on character development, which is why the first few episodes of Season 5 are not larger than life, like Community's famous paintball installments. And some ideas — like Abed's favorite TV show, Inspector Spacetime — were so overused last year that Harmon decided to retire them.

"I came into Season 5 gun-shy," Harmon says. "My mantra every morning was, 'Keep your feet on the ground and make sure each episode is understandable.'"

The much larger — and more painful — issue Harmon and McKenna faced was figuring out how to deal with the exit of Donald Glover, who plays Abed's best friend, Troy. The actor decided to depart at midseason to focus on other projects, including his hip-hop alter ego, Childish Gambino.

"I just watched the episode where Troy leaves, and it's heartbreaking," Harmon says. "It's a real Kleenex-boxer. I wrote it, I was there when they shot it, I'm editing it and I'm not even looking at a completed version, and my eyes were running like a faucet."

For more on Community, check out this week's digital version of TV Guide Magazine, available Thursday, Dec. 26!

Subscribe to TV Guide Magazine now!