© Niko Tavernise/Warner Bros.

Having already stirred up a fair amount of controversy for its nihilistic R-rated storyline, Joker has now come under fire for using a track by convicted pedophile Gary Glitter on its soundtrack.

The Warner. Bros film — which smashed opening weekend records with an international haul of $234 million — uses Glitter's 1972 hit "Rock and Roll Part 2" in a lengthy and pivotal scene, in which Joaquin Phoenix dances down a long flight of stairs and transforms into the iconic character.

Glitter, 75 — real name Paul Gadd — had huge success in the 1970s and 1980s as a star of Britain's glam rock scene, but fell dramatically from grace in the late 1990s after being arrested for downloading child pornography. In 2015, he was found guilty of attempted rape, four counts of indecent assault and one count of having sex with a girl under the age of 13, and sentenced to 16 years in prison.

Much of the anger on social media has centered on the fact that Glitter could be receiving royalties from Warner Bros. for using his song.

"Gary Glitter gets royalties for Joker. They're literally paying a paedophile to use his music in a movie about the consequences of child abuse. I'm off the fence - this movie is immoral bulls---," tweeted one critic.

I’m of two minds about this, to be frank. On one level, the film’s provocations are deliberately juvenile, bordering in on trollish. In actuality, the most morally questionable aspect of the film is the use of a Gary Glitter song, and the film is well aware of this. pic.twitter.com/h25dHrc4js — Darren Mooney (@Darren_Mooney) October 1, 2019

However, one Twitter user pointed out that Joker wasn't the first film to use a Glitter track, "Rock n Roll" having been played on 2004's Meet the Fockers.

The Hollywood Reporter has reached out to Warner Bros. for comment.

Related video: 'Joker' sets new October box office record (Provided by ABC News):