Actor William Shatner has revealed loneliness was a “huge aspect” of his Star Trek fame.

Shatner, 90, shot to fame as Captain James T Kirk, commander of the star ship USS Enterprise in Star Trek, which ran from 1966 to 1969.

He reprised the role several times over the years, as well as starring in hundreds of other films and TV shows.

But recalling the height of his fame in a song on an upcoming album, he admitted feeling isolated, despite his success.

“Loneliness is a huge aspect to what I felt all those years ago, but I’m still alive, I’ve still survived loneliness,” he said.

Shatner, who has been married four times and has three children, was referring to a song on his new album Love, Death And Horses, which is due to be released this summer.

He said: “The album is autobiographical and one of the songs is about loneliness, how much loneliness was a part of my life.

More on Star Trek

Subscribe to the Backstage podcast on Apple Podcasts, Google Podcasts, Spotify, Spreaker

“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?”

Shatner said he wished he had known being so famous would result in feeling lonely.

“Had I known all those things, I might have assuaged that, but, if I knew then what I know now, I wouldn’t know now what I know,” he said.

His latest role is alongside Jean Smart playing a retired NASA test pilot in the film Senior Moment.

He claims that his agent faces ageism when casting him for roles, saying: “They talk about ‘can we insure this guy?'”

But he says he is “the most creative” at 90 that he has ever been.

Senior Moment is available from 28 June.