Sir Ian McKellen has said Sam Smith might have misquoted him at the Oscars - but insisted it shouldn't detract from his achievement.

As the 23-year-old singer collected his Oscar for best original song for "Writing’s on the Wall" from Spectre at the Academy Awards on Sunday night, he mistakenly dubbed himself the first openly gay man to win an Oscar.

In doing so, he incorrectly referenced a quote by McKellen from a previous Guardian interview about homophobia within the film industry: “I read an article a few months ago by Sir Ian McKellen and he said no openly gay man had won an Oscar,” Smith said.

“If this is the case, I want to dedicate this to the LGBT community around the world. I stand here tonight as a proud gay man and I hope that we can all stand as equals one day.”

Oscars 2016 winners Show all 24 1 /24 Oscars 2016 winners Oscars 2016 winners Leonardo DiCaprio Oscar for Best Actor: "The Revenant" Oscars 2016 winners Brie Larson Oscar for Best Actress: "Room" 2016 Getty Images Oscars 2016 winners Mark Rylance Oscar for Best Supporting Actor: "Bridge of Spies" Oscars 2016 winners Alicia Vikander Oscar for Best Supporting Actress: "The Danish Girl" Oscars 2016 winners Alejandro González Iñárritu Oscar for Best Director: "The Revenant" Oscars 2016 winners Emmanuel Lubezki Oscar for Best Cinematography: "The Renevant" Oscars 2016 winners Mark Mangini (L) and David White Oscar for Best Sound Editing: "Mad Max: Fury Road" Oscars 2016 winners Margaret Sixel Oscar for Best Editing: "Mad Max: Fury Road" Oscars 2016 winners Lesley Vanderwalt (R), Elka Wardega (C) and Damian Martin Oscar for Best Makeup and Hairstyling: "Mad Max: Fury Road" Oscars 2016 winners Colin Gibson and Lisa Thompson Oscar for Best Production Design: "Mad Max: Fury Road" Oscars 2016 winners Jenny Beavan Oscar for Best Costume Design: "Mad Max: Fury Road" Oscars 2016 winners Tom McCarthy (L) and Josh Singer Oscar for Best Original Screenplay: "Spotlight" Oscars 2016 winners Adam McKay (L) and Charles Randolph Oscar for Best Adapted Screenplay: "The Big Short" Oscars 2016 winners (L-R) Steve Golin, Blye Pagon Faust, Nicole Rocklin, and Michael Sugar Oscar for Best Picture: "Spotlight" Oscars 2016 winners Jimmy Napes (L) and Sam Smith Oscar for Best Original Song: 'Writing's On The Wall' - "Spectre" REUTERS Oscars 2016 winners Ennio Morricone Oscar for Best Original Score: "The Hateful Eight" Oscars 2016 winners Laszlo Nemes Oscar for Best Foreign Language Film: "Son of Saul" Oscars 2016 winners Shawn Christopher Ogilvy (L) and Benjamin Cleary Oscar for Best Live Action Short Film: "Stutterer" Oscars 2016 winners James Gay-Rees (L) and Asif Kapadia Oscar for Best Documentary Feature: "Amy" Oscars 2016 winners Sharmeen Obaid-Chinoy Oscar for Best Documentary Short Subject: "A Girl in the River: The Price of Forgiveness" Oscars 2016 winners Pete Docter (R) and Jonas Rivera Oscar for Best Animated Feature Film: "Inside Out" Oscars 2016 winners Director Gabriel Osorio Vargas (L) and producer Pato Escala Pierart Oscar for Best Animated Short Film: "Bear Story" Oscars 2016 winners Andrew Whitehurst (R), Paul Norris (2nd L), Mark Ardington (L) and Sara Bennett Oscar for Best Visual Effects: "Ex Machina" Oscars 2016 winners Chris Jenkins (R), Gregg Rudolf (C) and Ben Oslo Oscar for Sound Mixing: "Mad Max: Fury Road"

Unfortunately for Smith, he had misquoted Sir McKellen, who in fact had said no openly gay man had won a best actor Oscar.

The slip saw Smith widely castigated, with the openly gay director Dustin Lance Black, who is the partner of British diving champion Tom Daley, tweeting the singer to make him aware of his mistake.

Sam Smith isn't the first openly gay man to win an Oscar.. Nor the 2nd

He wrote: "Hey @SamSmithWorld, If you have no idea who I am, it may be time to stop texting my fiancé".

McKellen, however, doesn't seem to care that he had been misquoted - and was more keen that Smith gets some recognition for winning an Oscar.