The Magicians has cast its last spell. The beloved fantasy series has been canceled by Syfy after five seasons, with the show’s season 5 finale, set to air on April 1, now set to serve as the series finale. But it was a cancellation that creators Sera Gamble and John McNamara foresaw (no, not through some prophetic ability), which allowed them to craft the season 5 finale into a proper series finale.

TV Line broke the news that Syfy has canceled The Magicians, making its currently-airing fifth season its last. The series, which stars Stella Maeve, Olivia Taylor Dudley, Hale Appleman, Arjun Gupta, Summer Bishil, Rick Worthy, Jade Tailor, Brittany Curran, and Trevor Einhorn, had accumulated a passionate fanbase since its debut on Syfy in 2016, surpassing the plot and popularity of the Lev Grossman trilogy books upon which it was based. “The Magicians has been a part of our Syfy family for five fantastic seasons,” the network said in a statement, adding:

“As we near the end of this journey, we want to thank John McNamara, Sera Gamble, Henry Alonso Myers, Lev Grossman, and our entire brilliant cast, crew, writers and directors for their beautiful creation. But most of all, we thank the fans for their tremendous support and passion. Because of you, magic will be in our hearts forever.”

Despite The Magicians‘ avid fanbase, including from /Film’s own Vanessa Armstrong who covered the series for us , its cancellation appears to have been a long time coming. In an interview with TVInsider about the cancellation, creators Gamble and McNamara said that the show had simply became too expensive for Syfy to justify its continuation.

“It played out kind of the way it’s played out almost every season,” McNamara said. “With the exception of Season 4 into Season 5, we never knew whether or not we’re going to get picked up. It was always a discussion—never really about the creative—about the financials and you always know, with any show, that there’s this kind of fine line between what it brings in and what it costs.”

But knowing that the series wasn’t getting enough ratings to balance out the production costs allowed Gamble and McNamara to make the season 5 finale work like a series finale. It’s not an uncommon practice on primetime networks for shows on the verge — Buffy the Vampire Slayer, Fringe, and more have done the same. McNamara said:

“We were aware that it was definitely not going to go forward in Syfy [when writing the finale] and that we were then going to want at least try to make a run at other platforms…None of them seemed in the end like a perfect financial or creative fit. And so we reluctantly just decided, ‘Well at least we have this season finale that was crafted to also be a series finale.’ It was kind of always going to pull double duty.”

The Magicians series finale will air on Syfy on April 1, 2020.