Caution: Spoilers ahead for Gotham season 5.

Gotham season 5's latest episdoe, "Ruin" featured a Riddler scene that heavily referenced Jim Carrey's iteration of the villain in Batman Forever. Cory Michael Smith has portrayed Ed Nygma in Gotham since the series debuted in 2014 but thus far in the show's fifth and final season, the character has been caught in a bitter battle between his own persona and that of his alter-ego, the Riddler. While one personality controls Ed in the day, another is taking over at night and seemingly has a dastardly plan in motion. As one personality attempts to discover the intentions of the other, Ed's two personas have been gradually merging into one entity.

This isn't too dissimilar to that of Jim Carrey's Riddler, the last live-action iteration of the character who appeared in 1995's Batman Forever. The movie saw Nygma, a somewhat well-intentioned but highly unstable genius, turn into the criminal mastermind known as the Riddler after a series of setbacks and failures took their toll upon his psyche. Like the movie itself, Carrey's Riddler received a mixed response from Batman fans, with some enjoying the actor's energy and trademark humor, and others becoming annoyed by the quintessential 1990s Jim Carrey comedy performance, facial gymnastics included.

Related: Gotham Officially Turns Selina Kyle Into Catwoman

Gotham has dropped plenty of Batman references in its four and a bit seasons but these have largely delved into the comics, Christopher Nolan's The Dark Knight trilogy or Tim Burton's duo of movies starring Michael Keaton. Rarely do Batman Forever or Batman and Robin get any love (fairly, some would argue) but Gotham certainly bucked that trend in its latest installment.

The reference came during the climax of "Ruin" after a series of twists and turns surrounding the mystery figure responsible for bombing Haven in last week's Gotham episode. Riddler spent much of the episode partnered up with Lucius Fox and the scientific duo took a forensic approach to their investigation, while Jim Gordon and Penguin took a more bullet-ridden route. Unsurprisingly, science got the better results and Riddler and Fox deduce that the explosion was caused by an RPG fired from a nearby rooftop. As Lucius takes that intel back to Jim, Riddler sees a wheelchair-bound old woman in her apartment who would've had an ideal view of the crime.

After heading over and speaking to the woman, however, Riddler discovers that it was actually his other persona that had blown up Haven, confirmed by a serious of head trauma-induced flashbacks. Realizing that he needs to keep the old lady quiet, Riddler takes hold of the woman's chair and wheels her straight out of a large open window.

Cory Michael Smith as Riddler Ed Nygma in Gotham

This scene is strikingly similar to an early Riddler moment in Batman Forever. Here, Nygma is an employee of Wayne Enterprises' technology division, but his project is shut down by Bruce himself for being unethical. Nygma continues to work into the evening regardless, but is discovered by his boss. This forces the future Riddler to knock his supervisor out, tie him to an office chair and push him out of the building's tall window, killing off the man who was trying to put an end to his plans.

Related: Gotham Season 5 Proves (Again) Why The City Needs Batman

Not only are the circumstances and set-up of both scenes very alike, but Gotham's direction in this episode (courtesy of Nathan Hope) actually mirrors that of Joel Schumacher in Batman Forever, with front-facing shots focused on the moving chair and a lower-left view of the fall itself confirming that the similarities of these two murders are no coincidence.

Aside from simply being a strong reference to a previous Riddler, there is perhaps a deeper meaning behind Gotham taking inspiration from Batman Forever. For Jim Carrey's character, the chair murder is truly the moment where Ed Nygma turns into the Riddler, making a decision he can no longer come back from. That ship has very much already set sail for Gotham's version of the villain, but while the show's Riddler has been around for a long time as a separate personality, this week's episode saw the start of a convergence - a point where it's no longer clear which actions are Nygma's and which are coming from Riddler.

By making a connection to the only other live-action origin story for Riddler, Gotham is perhaps hinting to fans that the true version of the villain, that everyone knows will eventually become a key member of Batman's Rogues Gallery, will emerge before Gotham season 5 concludes.

More: 25 Things Only True Batman Fans Know About Gotham

Gotham season 5 continues with Pena Dura January 31st on Fox.