British actor Sir Ian McKellen has described remaining closeted as “choking” a part of yourself.

The 73-year-old Sir Ian is best known for playing Gandalf in the Lord of the Rings film trilogy and Magneto in the X-Men films.

In 1988, McKellen announced he was gay in the pages of Gay Times and went to work advocating against Section 28, the UK legislation that banned any positive discussion of homosexuality in schools. It was not fully repealed until 2003.

At a secondary school event to discuss anti-gay bullying, Sir Ian said he “always knew” about his sexual orientation.

“There was no Graham Norton on the television at that time, no gay MPs, no-one talking about gay rights on the radio. So I dealt with it by trying to cut that part of myself off, to hide myself, to choke a part of me,” he told the students.

“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 at it,” he added.