William Shatner has opened up to The Guardian about the “loneliness” he experienced at the peak of his “Star Trek” fame.

Shatner became a cultural icon for his portrayal of Captain James T. Kirk of the USS Enterprise in the “Star Trek” franchise, which ran from 1966 to 1969.

The Canadian actor has reprised the role numerous times over the years, as well as starring in countless films and TV shows including “TJ Hooker”, “3rd Rock from the Sun”, “Boston Legal” and “Miss Congeniality”.

RELATED: William Shatner Says Before #MeToo Older Generations ‘Took A Certain Freedom’

The 90-year-old’s latest role is in “Senior Moment” alongside Jean Smart, as a retired Nasa test pilot and ladies man who loses his driving licence and meets a woman who changes his life. Discussing why he still works so hard, Shatner said: “I’ve got a very full creative life, I’m more creative now than I’ve ever been. And so that aspect of my life has not slowed down.

“As a young actor, you’re always balancing on the precipice of failure and you’re about to fall all the time. And you stumble back and something comes along and it’s successful, you’re OK for a while and then you agonize over everything.”

Shatner, who is also releasing an album, revealed he wishes he knew when he was younger that fame and success don’t curb loneliness. He said, “The album is autobiographical and one of the songs is about loneliness, how much loneliness was a part of my life. It is a part of everybody’s life, no matter how much attention you get, and how happily married you are, and how many children you have. As the song says, we’re all essentially alone and the big mystery is will there be anybody there at the end?”

RELATED: William Shatner Reveals He’s Never Watched An Episode Of ‘Star Trek’

Shatner said he attributes the energy he still has to “DNA, no question about it” and added: “I have lived a good life. I don’t do drugs, I don’t drink and smoke, and I try to exercise as much as possible, with good food.”However, he admitted he is suffering from a serious injury, saying: “My shoulder is shattered right now. I cracked the bone falling off a horse a couple of weeks ago. So my left arm is bad but I keep exercising it. It’s getting better and better.“But I’ve had the good luck of not having anything really debilitating. So nothing has sapped my energy.”