‘Castle” has been cancelled.

The long-running procedural will not return for a ninth season at ABC, Variety has learned.

The season finale next week on May 16 will serve as the series ender.

The news comes somewhat of a shock. Even though star Stana Katic is leaving the series, “Castle” has long been a staple on ABC’s schedule with a rabid fanbase.

Though the ratings have been the lowest this season than ever before, and ratings have declined over the past few seasons, the numbers have stabilized through the current run as interest has seemed to peak this season.

The cancellation comes weeks after news broke that leading lady Katic nor series regular Tamala Jones would return to “Castle,” if it were renewed for a ninth season. However, Katic’s co-star Nathan Fillion, who played the titular Rick Castle, recently signed a new deal to return, should the series come back.

Premiering midseason in 2009, “Castle” was created by Andrew Marlowe. The series saw a showrunner shuffle with David Amann taking over for just Seven 7, and then Alexi Hawley and Terence Paul Winter stepping in for Season 8. Marlowe remained close to the show, after he stepped down as showrunner.

Today, Marlowe took to Twitter after the show was cancelled.

To the whole Castle family- our amazing cast, our remarkable crew, our imaginative writers & our wonderful fans, thank you for 8 amzing yrs! — Andrew W. Marlowe (@AndrewWMarlowe) May 12, 2016

This season’s in-flux cast contracts were nothing new to “Castle.” Ahead of Season 8, Katic’s deal remained unclear leading up to the show’s renewal. This year, sources close to the show maintained that the drama still could return, even without Katic. However, the fan backlash since her departure was announced has been overwhelming on social media.

This season, “Castle” is averaging a 1.8 rating in adults 18-49 and 9.1 million total viewers.