Sir Ian McKellen has said being gay helped him to become a better actor because he spent so many years ‘pretending to be someone else.’

The 73-year-old British acting legend made these comments while touring secondary schools as part of a campaign by UK-based gay rights charity Stonewall aiming to tackle homophobic bullying.

Speaking to pupils in North London, McKellen said he ‘always knew’ he was gay but did not feel able to speak about it.

‘There was no Graham Norton on the television at that time, no gay MPs, no-one talking about gay rights on the radio,’ he said.

‘So I dealt with it by trying to cut that part of myself off, to hide myself, to choke a part of me.’

He added: ‘When you are made to feel you are so wrong for being who you are, that’s what you do.

‘I think that’s why so many great British actors are gay – we spent so long pretending to be straight, to be someone else, that eventually we became very good it.’

The ‘Lord of the Rings’ actor also urged children to not use the word ‘gay’ as a derogatory term.

He said he wished ‘every child, every teacher, every person in this room can be free to be who they are, whatever their sexual orientation.’

McKellen, who was knighted in 1991, has returned in his starring role of Gandalf The Grey in The Hobbit films.

The first out of the trilogy, The Hobbit: An Unexpected Journey, will be released worldwide on 13 December 2012.