Riverdale paid tribute to the late Luke Perry during the season four premiere episode, with his character Fred Andrews laid to rest.

Perry's death came during the third season of the series, with all remaining episodes in season three dedicated to him.

Showrunner Roberto Aguirre-Sacasa chose to wait until season four to address Perry's death and the exit of his character Fred so it could be done in a fitting and respectful way.

During the season four premiere, which aired in the US on Wednesday, the audience was informed about Fred's death after his son Archie, played by KJ Apa, discovered he had been killed after stopping at the side of the road to help a stranded driver.

Perry with his Riverdale co-stars

The stranded driver later appears in the episode and was played by Perry's Beverly Hills 90210 co-star Shannon Doherty.

In tear-jerking scenes, Archie sifts through his father's belongings in his truck, before a car pulls up behind him.

A mystery woman - played by Doherty - steps out and it is revealed she is the motorist Fred stopped to help. She says a prayer for Fred before leaving Archie and his friends to bring Fred back to Riverdale.

As they enter the town, its residents come out to honour Fred, holding up signs with slogans including "We will never forget you, Fred".

At the funeral, Archie delivered a tearful eulogy to a crowd of grieving family and friends.

"My dad was here for every high and every low. He's the greatest man I've ever known. It hurts me that I never got to say goodbye," he said.

"But his spirit and his memory lives on, in this town and in everyone he's met. Fred Andrews will always be a part of Riverdale. I love you so much, Dad."

The job of writing Fred's obituary is left to Archie's best friend, Jughead Jones, played by Cole Sprouse.

The main characters are seen reading the obituary while Sprouse reads it out via a voice-over.

It ends with him saying: "Fred left Riverdale better than when he found it. That's his legacy."

Click here for more television news