EXCLUSIVE: TBS has closed a deal with NBCUniversal for the cable syndication rights to the first five seasons of Brooklyn Nine-Nine. The pact, which starts in 2017, is for exclusive linear and associated on-demand rights, including rolling episodes on TV Everywhere. Brooklyn Nine-Nine just kicked off its fourth season on Fox, so the Season 5 component of the deal is contingent on the show being renewed for next season.

Primetime-Panic Your Complete Guide to Pilots and Straight-to-Series orders See All

No one would comment on the price, though industry sources estimate it to be around or under $500,000 an episode. The exclusive SVOD rights to previous seasons of Brooklyn Nine-Nine were sold to Hulu in 2014 as part of a multi-series deal between NBCU and the streaming service. The TBS deal gives the cable network exclusive rights against all linear exhibition of out-of-season episodes of Brooklyn Nine-Nine, including against broadcast syndication.

TBS always had been considered the likely cable home for Brooklyn Nine-Nine. In his previous job running Fox, TNT and TBS president Kevin Reilly developed and greenlighted Brooklyn Nine-Nine, which had been a passion project for him. The cop comedy starring Andy Samberg also fits into TBS’ new direction with original programming for distinctive single-camera comedies that are digital and socially driven.

Brooklyn Nine-Nine draws a large portion of its audience via time-shifting and video on demand, last season growing by an average of 56% in adults 18-49 rating from Live+Same Day to Live+7 (from a 1.21 rating to a 1.89) and increasing by more than 1.2 million viewers overall (2.7 million to 4.0 million).

Brooklyn Nine-Nine, which won Golden Globes for best comedy series and best actor, Samberg, in its first season, is produced by Universal Television, 3 Arts Entertainment, Fremulon and Dr. Goor Productions. It was created by Dan Goor and Michael Schur, who executive produce with David Miner and Luke Del Tredici. Co-starring alongside Samberg on the show is Andre Braugher, who has earned three Emmy nominations for his role as Capt. Ray Holt.

NBCUniversal also recently made a cable syndication deal for its Hulu comedy series The Mindy Project (which coincidentally Reilly also had piloted and ordered at Fox). It sold to VH1 and Freeform.