NBC is doubling down on Brooklyn Nine-Nine.


The network has renewed the comedy for a seventh season overall and second on NBC after it ran for five seasons on Fox.


"It's been one of our great joys as a network to give Brooklyn Nine-Nine a second life," Lisa Katz and Tracey Pakosta, co-presidents of scripted programming at NBC Entertainment, said Wednesday in a statement. "Cheers to [executive producers] Dan Goor, Mike Schur, Luke Del Tredici and David Miner, and our amazing cast and crew who each week turn New York's finest into New York's funniest."


The show's cast learned of the renewal Wednesday at a table read for an upcoming episode.


Fox canceled Brooklyn Nine-Nine last May as part of a purge of all of its live-action comedies at the end of the 2017-18 season. NBC picked up the series — which is produced by sister studio Universal TV — within 36 hours and slotted it for midseason. The network later expanded the show's order from 13 to 18 episodes.


The move has paid off, as Nine-Nine's ratings — 1.4 among adults 18-49 and 3.9 million viewers in Nielsen's live-plus-7 figures — are running ahead of the show's final season on Fox (1.3, 2.9 million). The show also brings in money for NBCUniversal via off-network syndication on TBS and streaming on Hulu.


NBC also says the comedy is among the strongest digital performers on the network, drawing 45 percent of its seven-day 18-49 rating from nonlinear sources. That's a higher proportion than any other NBC show.


Goor and Schur co-created the series and executive produce with Del Tredici and Miner. Schur's Fremulon, Goor's Dr. Goor Productions and 3Arts Entertainment produce with Universal TV.


The pickup for Brooklyn Nine-Nine comes a day after NBC renewed all three of its Chicago dramas. The Schur-produced The Good Place, Will & Grace and the rookie drama New Amsterdam will also return in 2019-20.