Riverdale: Here's How Shannen Doherty Factors Into Luke Perry's Tribute Episode

Tonight's season premiere of Riverdale served as a heart-wrenching tribute to series star Luke [...]

Tonight's season premiere of Riverdale served as a heart-wrenching tribute to series star Luke Perry, following the actor's sudden passing this past March. The episode saw Riverdale's ensemble honoring the lives of both Perry and his character Fred Andrews -- and it brought in someone closely tied to Perry's past to do so. The episode contained a cameo from Shannen Doherty, who had previously starred alongside Perry in Beverly Hills, 90210. While Doherty's involvement in the episode was announced at San Diego Comic-Con earlier this year, the role she was expected to play was a mystery -- until now. Spoilers for tonight's Season 4 premiere of Riverdale, "Chapter Fifty-Eight: In Memoriam", below! Only look if you want to know!

The episode saw the life of Archie Andrews (KJ Apa) come crashing down, after he had learned that his father, Fred, had passed away. FP Jones (Skeet Ulrich) informed Archie that Fred had been struck in a hit-and-run accident, while he was trying to save a motorist who was stalled out on the side of the road. Later, as Archie was motivated to bring Fred's body home early, he was given information from local police about exactly where the accident occurred.

Archie and his friends visited the site of the accident, and Archie began to go through the belongings in Fred's truck. Suddenly, a woman (played by Doherty) arrived, carrying a bouquet of flowers. Archie asked what she was doing there, and she revealed that she was paying her respects to Fred -- because she was the one he was helping at the time of his death. She told Archie that Fred ultimately died from pushing her out of the way of an oncoming car. She said that there was no way she could make up for what Fred did, but offered to say the Lord's Prayer for him. She then did so, as Archie and his friends held hands.

While "In Memoriam" has no shortage of emotional scenes, having Doherty play such a pivotal role in Fred's final moments is in a league all its own. And according to executive producer Roberto Aguirre-Sacasa, her appearing in the tribute episode fulfilled a wish that Perry had had for the show.

"[Her presence on the series] is something that Luke wanted to happen since season one," executive producer Roberto Aguirre-Sacasa said when Doherty's casting was first announced. "They were such good friends, and when we were putting together this tribute episode, we wanted to make it as special as possible, and so we asked Shannen to do a pivotal, super-emotional role. She read the script and immediately said 'yes.' It's very impactful."

Riverdale airs Wednesdays at 8/7c on The CW.