The X-Files originally ended its nine season run almost two decades ago. Followed by a brief renewal that reset the franchise and was accompanied by a number of movies, the show's true end was as muddled as the final seasons' writing. But the story of why The X-Files came to an end is more complex and coherent than many of the plots of the later episodes, and involves a perfect storm of cast problems, writing issues and unforeseeable catastrophes.

The X-Files focused on two FBI agents: David Duchovny's rampant conspiracy theorist Fox Mulder and Gillian Anderson's down-to-earth skeptic Dana Scully. Initially begrudgingly partnered together, the two agents were tasked with dealing with the strange and paranormal cases that the Bureau had branded "X-Files." Over the course of nine seasons, Mulder and Scully were established as cultural phenomena and the spooky procedural show wormed its way into peoples' hearts.

RELATED: Supernatural Is the Spiritual Successor to The X-Files

In fact, these two agents became so integral to the success of The X-Files that their eventual departure spelled the end for the series. Duchovny had already elected to appear as an intermittent main character in Season 8, and by Season 9 Anderson also scaled back her role. These later seasons focused instead on new main characters John Doggett and Monica Reyes, but the audience refused make this transition despite series creator Chris Carter's hope that the show could continue without Mulder and Scully.

X-Files Season 8 Cast

Along with the change of characters, Season 9 of The X-Files also featured an increasingly strange story arc involving super soldiers. After so many monster-of-the-week episodes and longer overarching narratives, the mythology behind The X-Files had grown so complex that even die-hard fans had trouble keeping things straight. Without stand-by characters to carry shoddy writing, the plot lines fell apart and drove viewers away.

RELATED: Why Terminator: The Sarah Connor Chronicles Ended After Two Seasons

But there was another nail in The X-Files' coffin. The final season aired starting in November of 2001, following the September 11 attacks. Carter and much of the rest of the cast attributed reduced ratings to the cultural fall-out of the attack, leaving a public that wasn't in the mood for a show about government conspiracies and death.

The combination of changing cast, loss of narrative focus and a shifting zeitgeist spelled the inevitable end for The X-Files after Season 9. But the show had originally intended to end after its fifth season. The Season 5 finale appropriately titled "The End" was meant to help transition the show into a series of feature films. Despite mixed reviews from critics, the season proved to be too popular for Fox to give it up, leading to The X-Files' being renewed for four more years.

RELATED: Why Gossip Girl Ended After Season 6

Even the eventual cancellation of The X-Files didn't spell the end for the series entirely. Carter and Fox brought the series back in 2016 for another two seasons, returning to the original formula of more intentionally crafted stories and, more importantly, bringing Duchovny and Anderson back. While a return to what brought The X-Files its initial success resonated with fans, even this version couldn't keep the show going.

With a false ending mid-series, a near total cast-shift that spelled the initial cancellation, subsequent movies and a resurgence 14 years after its departure, the story of when and why The X-Files went off the air is as full of twists as a story from the show itself.

KEEP READING: Why The West Wing Ended With Season 7