Sir Ian McKellen got told off for smoking on Buckingham Palace's famous balcony.

The 79-year-old actor has revealed he once got in trouble for lighting a cigarette on the East Front of the palace overlooking The Mall, which is traditionally where the royal family gather to greet crowds.

Speaking on the 'Graham Norton Show', he admitted: ''I was doing a concert at Buckingham Palace and was given a dressing room right next to the balcony and decided to have a fag on it.

''I was standing out there smoking with a view of The Mall when there was a search light on me and a policeman down below shouted up, 'Sir Ian, don't forget you're in Buckingham Palace!'

''Six months later I was there to get a medal and as I walked through the gate with a friend the same policeman said, 'Not you two again!' ''

Sir Ian was knighted at the palace in the 1991 New Year's Honours list due to his services to the performing arts.

However, the star - who came out at gay three years earlier - has admitted he wouldn't have accepted the knighthood if he wasn't open about his sexuality.

He previously said: ''I will always be glad that I didn't accept the knighthood until I'd come out of the closet.

''If you're lying about that central part of your nature, can you be trusted? I think that's why when people come out the reception is usually positive. People like honesty.''

However, he defended his decision to keep his sexuality away from his parents, Denis and Margery, although he thinks they would have accepted that he was a gay man.

He added: ''What my parents believed in was a Christian view of the world, a non-conformist view of the world in which people cared about each other, whether they knew them or not. They believed that people should always be treated with respect and sympathy, which is why I think if I had come out to my parents it might've been a surprise and a shock to them, but they would have accepted it. That's what I like to think.''