"Adventure Time" was the hit that nobody saw coming, and its end is in sight. How did it manage to last this long?

“Adventure Time” has a long way to go, but in many ways, it already ended. In early February 2017, just a few months after Cartoon Network notified the team behind its most surprising breakout hit that the show was canceled, the cast finished their last round of voice work. The final episodes were written, and the saga of Finn and Jake in the magical, post-apocalyptic Land of Ooo came to a close as the cast and crew scattered to new projects. The fruits of their labor will gradually unfurl on Cartoon Network until 2018 — although the timing remains uncertain. Fans must wait for the slow march to the finale, but the creative team is moving on.

“It was bittersweet,” said head writer Kent Osborne, recalling the last day of recording. “A lot of shows don’t last this long, but this felt different because it was just so popular.”

“Adventure Time” was a trailblazer that nobody saw coming. Not its reclusive creator, Pendleton Ward, who left his top job on the show two years ago, and certainly not Cartoon Network, which never knew quite how to handle its success. “It was a creative and unique show,” said one former Cartoon Network staffer. “It was a risk. People at the network were scratching their heads.”

Yet from its early days, “Adventure Time” not only enthralled younger viewers but managed to win over countless older ones initially skeptical to its appeal. Since Ward first launched the saga as a surreal short film in 2008, its episodes have oscillated between the deep, existential yearnings of diverse characters waking up to the world and sophomoric gags, sometimes within the span of a few minutes.

Not since “The Simpsons” has a major network supported such a peculiar combination and gotten away with it for so long. However, according to multiple sources who worked on the show over the years, Cartoon Network never knew quite how to handle the way “Adventure Time” took off.

“It was a gradual burn and grew into a realization that this was indeed a massive epic that could be made into a pop culture powerhouse,” the former staffer added. “It never really fit into a category, so Cartoon Network didn’t really have a model in which to manage its ever-growing popularity.” And arcane corporate rules prohibited the company from shifting it into the more sophisticated arena of its Adult Swim programming.

Even as the ancillary potential of the show grew, with toys and costumes, comic books and video games, it expanded beyond the narrow parameters of the Cartoon Network viewership. “Cartoon Network aims for kids ages two to 14,” said veteran animation producer Fred Seibert, whose Channel Frederator picked up Ward’s original short and has remained involved in the series over the course of its seven season run. “The fact that ‘Adventure Time’ has a significantly larger audience for that, a more expansive one, is great gravy…but they can’t benefit from it directly.”

Now, with the show finished, Cartoon Network has yet to announce a timeline for the rest of the show aside from plans to air episodes through early 2018. In the meantime, a new season has started in fine form. “Islands,” an eight-episode arc that the network released as a “mini-series” on DVD and iTunes last month, marks some of the most exciting storytelling attempted by the show in years. Viewed in one sitting, it amounts to a feature-length journey, in which Finn and Jake join forces with the monosyllabic underground dweller Susan on a revelatory journey to find Finn’s mother — not to mention all the other humans mysteriously absent from the Land of Ooo, where Finn spends most of his time with various fantastical creatures.

Over the course of “Islands,” the group careens across the ocean in an Odyssey-like trip, face down with a moody sea monster and eventually find themselves in an isolated land. At last they come across the last human civilization, and it’s not a pretty sight: They’re trapped in an idyllic virtual reality that keeps them safely removed from the dangerous world around them, at the behest of a kindly doctor who may or may not be Finn’s missing mom. The explanation for her disappearance also invokes the backstory of Finn’s deadbeat dad, and it brings the story a degree of emotional closure that will astonish anyone whose main relationship to the show is Jake singing the “Bacon Pancakes” song. The final shot, in which the boy who has slowly become a man rides off into the sunset, plays like a series finale — and as far as Finn’s arc goes, it may be just that.

When the writers found out that Cartoon Network had canceled “Adventure Time” last fall, they rejiggled the eight-part installment, pushing it to a later date so they had more time to think it through. “As we got farther along, and Finn got older, it felt inevitable that he would be thinking about the question of his origin and pursue answers if he had the chance,” showrunner Adam Muto said via email. “There are some loose threads that definitely need to be resolved before the show ends. For a long time, Finn’s origin story didn’t seem like one of those threads.”

Then the show took off. “The more seasons we got, the more glaring that mystery became,” Muto explained. “So I’m glad we were able to tell this story though I don’t think it’s the end of Finn’s story. In a way, it sort of frees him to have a completely unexpected ending. He’s not a chosen one with a grand destiny or the last anything. He’s the son of a doctor and a con man trying to figure stuff out in a colorful magical land.”

For much of its run, “Adventure Time” has dedicated a handful of episodes to this type of world-building, in between bottle episodes showcasing its unique storybook quality. Last fall, the “Stakes” story arc gave one of the show’s most popular female characters, Marceline the Vampire Queen, an opportunity to make peace with her undead status.

Muto hinted at another loose end the show may address in future episodes: The Ice King, at first a goofy villain known for constantly peppering Finn and Jake, turned out to be a scientist who lost his mind after wearing a cursed crown. (He also raised Marceline in the days before he went completely bonkers, and the early episode that revealed their tragic history was one of the most groundbreaking in the history of broadcast animation.) Later seasons revealed that the Ice King had a girlfriend named Betty (memorably voiced by Lena Dunham) whose affection for the senile man stretches across boundaries of space and time. It’s one of the many powerful relationships that have become the cornerstone of a show that keeps inventing new ways to surprise its audience. “Making so many episodes has given us the platform to tell varied and ongoing stories we wouldn’t have had a chance to otherwise,” Muto said.

Ward never planned “Adventure Time” with a mythology in place. In its early days, he compared the writing process to playing “Dungeons & Dragons,” with writers incorporating new ingredients into the Land of Ooo canon as they moved along. The world of the show, destroyed by an earth-shattering nuclear catastrophe, wasn’t even a part of his original pitch — but it has since become an essential part of the way longtime viewers appreciate its bittersweet edge. No matter the colorful and giddy antics that define Finn and Jake’s everyday lives, they’re never too far removed the reality of an Earth obliterated by war and desolation. The open playing field was something of a boon to the creative process, and “Adventure Time” became a natural fit for storytelling in the age of Reddit conspiracy theories — littered with clues, but open to endless interpretation. “[Ward] did what great jazz composers do,” Seibert said, “bringing in all sorts of people, giving them building blocks and then letting them bring their own ideas to the table.”

At times, the rules governing the characters’ existence have posed a series of challenges for the team, since each 11-minute episode can only cover so much ground. “We try to remain consistent with what’s been established on the show when we can,” Muto said. “There’s a risk of getting unwieldy with over-explanation and recapping, so we do leave some spaces to the imagination.”

Of course, imagination drives the narrative of “Adventure Time” more than anything else. It’s not hard to imagine a reading of the show in which every episode exists within the confines of Finn’s mind. Early on, Ward decided that Finn voice actor Jeremy Shada would continue to play the character, which meant that Finn had to age as Shada’s voice deepened, and the themes followed suit. From its wackier early bits, “Adventure Time” careened into weirder conundrums rooted in metaphorical possibilities: There’s the one where Finn and Jake find themselves battling through The Infinity Train, caught in an endless loop, or the one where Finn must learn to trust his senses by escaping a cave with his eyes closed. “When the funny stepped aside,” Seibert said, “you started to see that emotional content come to the forefront.”

The show even incorporated some audacious gender swapping, hinted at a romance between two of its female leads, and killed off some supporting characters. All the while, it remained cute, funny and random, juggling the kind of freewheeling style more familiar to readers of alternative comics. Fans of all ages and sensibilities swarmed in. “The popularity came out of nowhere,” Osborne said, recalling the jolt of seeing someone dressed up in a Finn costume at Comic Con after the first season. “We were just trying to make something we liked.”

Ward, a portly, bearded introvert better positioned for the drawing board than the microphone, started to get weary. “Pen’s such a creative guy, and at a certain point, running a show isn’t super-creative.” Seibert had warned the creator that the television production flow involved in juggling multiple episodes at once would get to him. “That weight and that beard are there for a certain kind of protection,” Seibert said. “He’ll never quite say what’s on his mind to anyone. As you can tell from the show, Pen is a sensitive guy. He needed to step back, for his own sanity.” As Princess Bubblegum says at one point on the show, “All of my jokes are cries for help.” (Ward did not respond to requests for comment.)

“He’s expressing thoughts about very modern feelings that people have,” longtime writer Rebecca Sugar told me in 2016, shortly before she launched her show “Steven Universe.” “These feelings are frivolous, and that’s confusing. Good poetry is like that. Penn is letting that happen. That’s why he’s such an enigma — he’s an amazing artist.”

That also made him retreat from the pressures of fame. “He wasn’t up to the monumental task of running a franchise,” said an ex-staffer from the network. “Toys, events, corporate meetings, all the trappings that come with a series success. He was a young, quiet, shy artist who just wanted to draw and tell stories.”

In his free time, Ward has been focused on video games and virtual reality projects, but he remained in the writers room through the production of “Stakes,” and continued to voice the memorable diva Lumpy Space Princess. In the meantime, “Adventure Time” has maintained much of its appeal in the capable hands of Muto, Ward’s old college pal from CalArts. “It might sound glib, but almost everything is possible in animation,” Muto said. “I think most people who work in animation would tell you that. The challenge for our specific U.S. extended cable cartoon niche is finding the support to go down strange, underutilized avenues. There doesn’t usually seem like a push for the new and different in children’s animation.”

But they won’t stop pushing for it. While Sugar continues to ride the success of “Steven Universe,” other alumni have plans of their own. Storyboarder Julia Potts’ short film “Summer Camp Island” (a hit at the 2017 Sundance Film Festival) was recently picked up as a series, and several “Adventure Time” alumni — including Osborne — have joined its staff. Osborne also has a web series called “Cat Agent” entering its second season.

He spoke wistfully of his time on “Adventure Time,” and suggested it still had a future. “I think they can reboot it anytime,” Osborne said. He recalled a conversation with Tom Kenny, who voices the Ice King. “[Kenny] said, ‘Just this week, I’m doing voice work on ‘Teenage Mutant Ninja Turtles,’ ‘Powerpuff Girls’ and ‘Samurai Jack,'” shows that have concluded now more than once. This isn’t the end of anything.”

Osborne also mused on the possibility of a prequel spin-off featuring Joshua and Margaret Investigations, the husband-and-wife dog team revealed as Jake’s parents in early flashbacks. (Osborne does the voice for Joshua.) But he also acknowledged that the show’s popularity would be tough to replicate. “My first job was on ‘SpongeBob Squarepants,’ but then I went to a show that wasn’t as good and people were like, ‘You were really lucky that first time.’ You never really know when something’s going to be a phenomenon.”

Nor do you ever really know what to expect from “Adventure Time,” which never hesitates to slip complex musings into its otherworldly tapestry. Not every episode digs deep, but that possibility has always lingered on the edge of the frame, and led to some of the most exciting and unpredictable television viewing experiences in the modern age — and often a handy guide to the world outside its parameters. “We’re on, like, the bleeding edge of history,” says the character Jake Jr. to his dad in one revealing moment. “Everything ahead of us is totally unknown and there’s no guarantee that everything’s going to be alright. It’s exciting, but it’s also pretty scary. You know?”

We do. But if the “Adventure Time” legacy stands for anything, it’s the value of confronting that fear, wide-eyed and ready for something different.