[Warning: The following contains spoilers for the latest episode of The Walking Dead. Read at your own risk!]

Andrew Lincoln performed his last episode as Rick Grimes on The Walking Dead Sunday night, and the way the show wrote him off — with Rick getting into a helicopter and flying away — is exactly what we thought it would be. But how it happened and what happened immediately after were where the surprises came in: in the form of a time jump of approximately six years. The dreamlike episode was a creative and respectful tribute to a character and an actor who have played an integral role in making The Walking Dead into the biggest show on television. Without Lincoln, the show faces an uncertain but exciting future, but it's gonna get there with pizzazz. And Lincoln's not truly gone anyway. Immediately after the episode aired AMC announced that Lincoln would be starring in a trilogy of Walking Dead movies.

The episode, titled "What Comes After," started with rebar-impaled Rick having a vision of himself as he was when The Walking Dead began, waking up in a hospital bed all alone. "Wake up, it's time to go," Old Rick told Young Rick, but it wasn't Young Rick who needed to go, it was Old Rick. He came to and found himself stuck to a pile of rubble as walkers closed in. So he took off his belt, looped it around a piece of rebar above him for leverage and pulled himself off the spike, screaming and bleeding. It wouldn't be Rick's last episode if he didn't do some gruesome heroic act.

Should You Keep Watching The Walking Dead Without Rick Grimes?

Afterwards, Rick got on his horse, rode to an abandoned cabin and passed out. There, he had a vision of himself riding into Atlanta on horseback, just like he did in the pilot. He met Shane (Jon Bernthal), his old partner, sitting in their police cruiser at the scene of where Rick got shot before the world fell apart. Rick told him he's looking for his family. "One could argue it's my family you're looking for, right?" the Shane vision answered, before asking if his daughter Judith has his eyes. Shane said he takes credit for pushing Rick to be the violent "asshole" he needed to be to lead and survive, because Rick really became that person when he killed Shane. And Shane said he needed Rick to be that person now, because that's the only way he'll survive this injury.

Rick also took the opportunity to apologize for what he did to Shane — not that Shane seemed to care much. "You need to forget that sh--," Shane said. That's what making amends likes look on The Walking Dead, and it was a nice way to heal Rick's emotional wound that he's carried since Season 2. Plus, it was great to get to see Jon Bernthal on The Walking Dead again. The show would not have succeeded in the early days if it weren't for him and the tension between Rick and Shane. Bernthal and Lincoln have such great chemistry. The Walking Dead chief content officer Scott Gimple said that the expanded universe could include stories revisiting departed characters, so it might be cool if they could figure out a way to do that with Shane.

After getting some closure in his dream, Rick came to as the cabin was being overcome with walkers but he managed to make it out, narrowly escaping death once more and heading toward the bridge to protect it from the herd, because if he loses the bridge, the communities will be cut off from each other and his and Carl's (Chandler Riggs) dream of uniting the groups will die.

Here, the episode took a break from Rick's farewell to resolve Maggie's (Lauren Cohan) story. Cohan also left the show this episode, though with less fanfare because she might come back in Season 10 depending on what her schedule allows. But Maggie got closure for her arc with Negan (Jeffrey Dean Morgan) when she finally went to see him in his jail cell at Alexandria. She had vowed to kill him to get justice for Glenn (Steven Yeun), her husband who Negan brutally murdered. Michonne (Danai Gurira) initially wasn't going to let Maggie see him, but "The Widow" convinced her to do so when Maggie pointed out that if Negan had done this to Rick, he would be dead, and that she just can't live like this anymore. She asked Michonne to give her a way, any way, to move on, and Michonne couldn't come up with any suggestions. Cohan's performance was convincing, and Michonne let Maggie in.

At first, Negan taunted Maggie about how much he enjoyed killing Glenn in an attempt to goad her into killing him with the fireplace poker she brought with her. But Maggie realized that he was begging her to kill him. He wanted to die because he can't live like this, trapped in a cell all alone. He broke down, sobbing pathetically, begging her to put him out of his misery. She refused. "I came to kill Negan, and you're already worse than dead," she said. "That settles it." After two and a half seasons of mourning Glenn, it was a satisfactory merciful end to the story. If Maggie ever returns from her sojourn in Toledo, where she's probably gone to learn more from Georgie (Jayne Atkinson), she'll have a new story rather than have to rehash the revenge one.

Lauren Cohan Gets Real About Why She's Leaving The Walking Dead

Meanwhile, Rick's vision quest continued with a visit from Hershel (Scott Wilson), who told him that his daughter Maggie is strong and Rick doesn't have to worry about her. Rick then imagined himself going through the "DON'T OPEN, DEAD INSIDE" doors from the pilot and walking into an infinite field of dead bodies, including the bodies of people Rick had known, both living and dead. Shane and Beth (Emily Kinney) were there, as were Michonne and Daryl (Norman Reedus), among many, many others. Even director Greg Nicotero was there, making a sneaky corpse cameo. Sasha (Sonequa Martin-Green) emerged from the pile and gave a speech telling Rick not to despair, he had done all he could. No one really dies, because they all live on together. It was a way of acknowledging that the show was bigger than any one person and could go on without Rick.

When Rick woke up from that vision, he found himself in the bridge camp, which was overrun with walkers. He made it to the bridge and had a vision of Michonne telling him she fell in love with him because he's a fighter and he never gives up. He came to at one end of the bridge, with walkers coming across. He was hoping that their weight would collapse the unfinished bridge, but his people are apparently really good at construction and the bridge held. As Michonne and Maggie and his other friends arrived, he saw a box of dynamite on the bridge. He raised his trusty revolver and fired. Kaboom. The camera cut to Daryl, who broke down, thinking his brother from another mother was dead.

But he wasn't dead. Jadis (Pollyanna McIntosh), waiting downriver for the helicopter arrive, spotted him washed up on the riverbank. She told the chopper that she had someone for them, a friend who had saved her and for whom she was going to return the favor. The screen blacked out, and a few seconds later came back on Rick's face, with oxygen tubing under his nose like it was the first time we ever saw him. He was in the helicopter with Jadis. "You're gonna be okay," she said. "I'm gonna save you." We don't know who Jadis and Rick were with or where they're going, but Rick's alive. And we're going to find out all those details pretty soon when AMC makes Rick Grimes: The Movie.

Andrew Lincoln to Star in Three The Walking Dead Movies

The helicopter flew over a barn and disappeared into the distance. The image dissolved. The barn had collapsed, signifying that many years had passed and with that time jump we entered the new era of The Walking Dead. Magna (Nadia Hillker), Yumiko (Eleanor Matsuura), Luke (Dan Fogler), Connie (Lauren Ridloff) and Kelly (Angel Theory) were fighting a losing battle with walkers when suddenly gunshots rang out. The walkers went down, allowing the new travelers to escape. They found who had saved them: a girl of about 10, bearing a revolver and a sword and wearing a very familiar sheriff's hat. They asked her name.

"Judith," she said. "Judith Grimes."

Carl died so Judith could live. The show will now go forward, many years later, with Judith (Cailey Fleming, an old pro of a child actor who played Young Rey in The Force Awakens) around the age Carl was in the comics. It looks now like Chandler Riggs was written off because he was too old for the Carl storylines the writers wanted to do. So now the show has a kid again. A little warrior girl.

The time jump is audacious. It's the second time jump of the season, so we're now about seven and a half years after the end of Season 8. The comics never made this second jump, so this is a big break from the comics continuity. The comics also didn't send Rick Grimes away in a helicopter, so we're truly in uncharted territory here.

I was very surprised by how Rick Grimes' exit went down. Even though I thought I had an idea of how it was going to go, I was not expecting it to happen as wildly as it did. The writers were just like "all right, let's go for it," and hit us with the one-two punch of Rick Grimes surviving an explosion and jumping forward in time a bunch of years. The dynamite was silly, as were Rick's repeated close calls and the fact that Jadis was in exactly the right place at the right time, but the mood was right, and that's what's more important. It felt unexpected and inventive. I think the show will feel the loss of Rick Grimes, but it won't be destroyed by it. Angela Kang has a plan for the future, and I'm curious to see where she takes it. For the first time in awhile, I'm excited about The Walking Dead.

And the Whisperers are coming.

The Walking Dead airs Sundays at 9/8c on AMC.

PHOTOS: The Bloodiest Shows On TV

Andrew Lincoln, The Walking DeadAndrew Lincoln, The Walking Dead