Brooklyn Nine-Nine's been cancelled and fans are not pleased

Channel 4/Universal Television Andy Samberg and Melissa FumeroChannel 4/Universal Television

Brooklyn Nine-Nine fans are angry that the popular show is coming to an end, calling the move a "mistake".

Fox says the final episode of the fifth and final season will air later this month.

Cast members have thanked fans for an outpouring of support following the show's cancellation, which was reportedly due to a drop in ratings.

Celebrities like Lin-Manuel Miranda have joined calls on social media for the show to be renewed.

The show, which developed a cult following after launching in September 2013, has been praised for its "intersectional representation" and "inclusive humour".

It stars Andy Samberg and Andre Braugher, and follows a team of detectives in the New York City Police Department.

Online reaction to the news ranged from shock to disappointment.

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.

Many fans are hoping another network might pick the show up.

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Celebrities have also tweeted their support, including the Backstreet Boys and Lin-Manuel Miranda.

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Melissa Fumero, who plays Amy Santiago, said starring in the show had been a "huge honour".

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

She tweeted: "I am still processing... don't have all the words.. but.. These last 5 years have been incredible. Thank you for all your love and support. We have the best fans."

Terry Crews, who plays Terry Jeffords, and Joe Lo Truglio also tweeted their reactions.

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.
Presentational white space

Allow Twitter content?

This article contains content provided by Twitter. We ask for your permission before anything is loaded, as they may be using cookies and other technologies. You may want to read  and  before accepting. To view this content choose ‘accept and continue’.

Brooklyn Nine-Nine is the second longest-running live action Fox comedy after New Girl.

Despite a 100% critics' rating on Rotten Tomatoes, as well as a 95% audience score, there were rumours that its network ratings were sliding.

The series finale will air on 20 May in the US. E4 is still airing the remainder of the fifth season in the UK.

Follow Newsbeat on Instagram, Facebook and Twitter.

Listen to Newsbeat live at 12:45 and 17:45 every weekday on BBC Radio 1 and 1Xtra - if you miss us you can listen back here.