Shannen Doherty to Guest Star on 'Riverdale' Episode Paying Tribute to Luke Perry

Shannen Doherty is going from Beverly Hills to Riverdale.

The "90210" star is guest-starring on the season 4 premiere of "Riverdale," a stand-alone episode that will pay tribute to Luke Perry.

"I am deeply honored to pay tribute to Luke on Riverdale," Doherty wrote on Instagram. "The care in which this show takes in honoring his memory is beautiful. He is missed. Today. Tomorrow. Forever."

"Riverdale" executive producer Roberto Aguirre-Sacasa told "Entertainment Tonight," "Luke and Shannen were really, really good friends. Luke had talked to me on and off over the years about trying to find something for Shannen on the show and when we were putting together this special episode, we kind of wanted to include special people from Luke's life."

He explained how they got Doherty to play the role, saying, "There was a very emotional, important role and we sent the script to Shannen and she read it and loved it and said, 'I want to do it,' so it's about honoring their friendship a little bit."

Aguirre-Sacasa also went into detail about how the episode will honor Perry.

"It's almost going to be a stand-alone episode," he explained. "It's going to reveal the fate of Fred Andrews and it's set on July 4th. It's a really emotional episode; it's a tear-jerker. We had the table read for it about [two weeks] ago and I'm not going to lie, we were all crying. But we think it, again, honors the memory of Luke [and] It honors the memory of Fred. They were both such amazing human beings that we wanted to really, really craft an emotional and deep tribute to him, which is what I hope this episode is."

During a Comic-Con panel on Sunday afternoon in Hall H, Aguirre-Sacasa spoke about how Perry's passing effected him and the show.

"We suffered a huge, huge, huge loss and it's something we're going to be feeling for as long as we're lucky enough to keep making the show," he said. "I remember when Luke auditioned, he came up to me and said, 'I loved this script and when I read the character Fred, I liked him because he is just like me. I have a son and he is just like Archie.'"