Spoiler alert: This story contains significant details from Sunday’s episode of “The Walking Dead.”

Sunday’s episode of “The Walking Dead” was touted by AMC as “Rick Grimes’ Last Episode.” By the end, however, the zombie action-thriller’s leading man appears to be 180 degrees from the show’s title: He isn’t walking, but he isn’t dead, either.

What that means for Rick, since this is the last series episode for the character and the actor who plays him, Andrew Lincoln, is anybody’s guess. But a series of three TV movies will continue his story, AMC announced Sunday.

At the end of last week's episode, viewers saw Rick impaled on rebar jutting from a concrete slab after his spooked horse threw him as a swarm of walkers approached. But there was no way Rick was going to end up as zombie chow, which would have been an ignominious demise for the walker-slaying hero.

As Sunday’s episode opens, Rick is back in the hospital room where the series began. It's clear he's in a hallucinatory state as he’s talking to his bedridden earlier self, who had awakened from a coma to find the zombie apocalypse had started.

Back in the real world, the resourceful lawman pulls a MacGyver, throwing his belt over another piece of rebar and pulling himself up from where he had been pinned. He escapes on the suddenly calm horse and, in true selfless form, attempts to lead the walker horde away from his comrades’ camps even while bleeding profusely.

At the same time, junkyard Jadis (Pollyanna MacIntosh) – who has abandoned her alter ego Anne – is trying to escape from Father Gabriel (Seth Gilliam), Rick and the other survivors after her secret partnership with a mysterious group that owns a helicopter is found out.

She has made a deal for exfiltration; she has to deliver a survivor, although she can’t bring herself to take Gabriel, with whom she has developed an emotional and romantic bond. The Jadis back story will play a significant role later in the episode. (There’s also an important Negan story pitting Michonne against Maggie, but Rick’s fate is the main event.)

The action shifts back to the main stage as fading Rick, his blood staining his horse’s white coat, starts to hallucinate again, taking longtime fans back to memorable moments and characters. In a fitting flashback, viewers see Rick in a famous shot from the first season in which he’s riding a horse on a highway outside Atlanta, with thousands of walkers in the picture.

Rick comes to again – he jumps back and forth between consciousness and unconsciousness – just in time to escape the ghoulish masses, taking refuge in an abandoned house where he fashions cloth into a bandage for his side. He drifts off. During his hallucination, he runs into a familiar face, former sheriff partner Shane (Jon Bernthal), who became a rival killed by Rick way back in Season 2.

When Rick says he’s searching for his family, Shane says it could be his, since Rick has long believed that his daughter, Judith, is really Shane’s child from a relationship started with Rick's wife, Lori, when they thought he was dead.

Suddenly, Rick revives from his trance as a walker is about to bite him. He escapes from the house. The horse, of course, is standing right there. As Rick is riding, he passes out again and finds himself on a beautiful farm with the long-dead Hershel, Maggie’s father and a wise mentor for Rick. As Rick explains he needs to find his family, Hershel (Scott Wilson, who died in early October) sagely advises that he doesn’t before warning him to wake up – because the zombies are approaching!

In his next hallucination, Rick is back in the first hospital, walking through the doors that were barred to hold back walkers. He enters an area strewn with bodies, including ones that look from behind like his son, Carl, and Hershel's daughter, Beth, who both died earlier in the series. Suddenly, another deceased survivor, Sasha (Sonequa Martin-Green, perhaps beaming down from “Star Trek: Discovery”) rises and tells an upset Rick that all is OK despite the bodies.

“You did your part, like I did mine. They gave us the strength that we needed to do what we had to do for the others. The others draw strength from us. We change each other, we help each other, we make each other better, and it never ends,” she says.

Sasha then tells hallucinating Rick to wake up, just as he’s falling from his horse in reality. He fights off a few walkers, then heads toward the bridge that he had been so focused on repairing during early episodes this season.

When he gets to the bridge, he imagines his allies – Daryl, Carol, Eugene and his beloved partner, Michonne – coming to his rescue, but they’re not really there. He revives again, but the hope that the bridge might collapse under the horde’s weight doesn’t materialize.

The zombies approach, as do Daryl and the others – this time for real – but they can’t save Rick. A walker knocks over some dynamite on the bridge, and Rick chooses his final option. He shoots the explosives, blowing up many zombies – and apparently himself – as other walkers fall into the river.

Michonne silently screams as Maggie and Carol try to console her. A despondent Daryl walks away.

The scene cuts to Jadis, still awaiting her own evacuation, as she watches dead zombies float downstream before seeing Rick, barely alive, on the shore. The helicopter, seen in an earlier episode, flies them both away. “You’re going to be OK,” Jadis tells Rick, who lies on a stretcher. “I’m going to save you.”

The action cuts to a new scene where strangers are struggling to stave off another group of walkers, who are enjoying their greatest amount of screen time in ages this season. An unseen sniper shoots some walkers, allowing the people to get away.

The shooter is Rick’s daughter, Judith, but she’s no longer a toddler. She’s at least a few years older, a young authority figure wearing her dad’s hat, her brother's favorite accessory, and armed with a gun, a reminder of her father, and a katana sword, the symbol of Michonne, who has become her stepmother.

It’s the future. And Rick is no longer there. But the first of the new films will "explore the story of where Rick is taken and what he faces in a new corner of the zombie apocalypse."

In a statement accompanying the announcement of the films, the first of which begins production next year, Lincoln said: “It’s not the beginning of the end, it’s the end of the beginning. And I like the idea that we get to tell a bigger story, maybe with a sort of wider vista. … Maybe it’s the start of a bigger story.”

AMC also says "The Walking Dead" universe will expand further with other specials, series, films and digital content.