Ian McKellen has entreated gay people in the closet to ‘come out’.

In an article for the Times, published today, he wrote: “For me, coming out made me unburdened and more self-confident.

“It made me a better actor. It opened me up emotionally. It’s amazing that it’s an experience that people who you’ll never meet, in places in the world you’ll never go to, can relate to. It’s one of the best things I’ve ever done.”

McKellen didn’t publicly come out until 1988 when he was 49 years old. The date is telling – 1988 was the year that Section 28 was passed as an amendment of the Local Government Act. The amendment stated that schools and local authorities were not to “promote homosexuality” or teach “the acceptability of homosexuality as a pretended family relationship”. This legislation, McKellen said, was the catalyst to him announcing his sexuality in public.

“That’s when I made the connection between the personal and the political,” McKellen explained. “Section 28 made gay people second class and it felt right to stand up and say so, to say: ‘I’m not ashamed’.”

“I feel the same way today,” the actor added. “Come out, it’s got to be done.”

McKellen has been working as a stage and screen actor since his graduation from Cambridge in 1961. Although probably best known for recent film roles including Gandalf in Lord of the Rings and Magneto in the X-Men films, he has also had a long-running career as a gay rights activist. He is a founding member of Stonewall and gives talks in “faith, comprehensive and private” schools about gay rights.

“I didn’t think of myself as the leader of anything,” McKellen wrote. “I accepted the knighthood [in 1991] because I knew that it would help to get doors open. I never felt that being known as gay, or campaigning for gay rights, was limiting.”

In his article, he urged other high profile figures to come out: “I wish that a major sportsman or woman would come out, that would make a huge difference. We need more role models in the public eye, and I know that some of those people are fearful about how people would perceive them if they came out.”

McKellen, who lived with the theatre director Sean Mathias for eight years, is a strong proponent of full and equal gay marriage. “I think there should be full equality, full marriage rather than partnership rights,” wrote McKellen. “It’s only a matter of time, and the Church and whoever objects should just stop worrying about it. It’s not the end of civilisation.”

“Everyone should feel that they have the right and opportunity to live openly,” he concluded.