Kevin Spacey has apologised to actor Anthony Rapp who accused the Hollywood star of making a sexual advance towards him when he was 14 years old.

Admitting publicly for the first time that he is gay, Spacey said he could not remember the alleged 1986 incident with Anthony Rapp, but said he was "horrified" by the story.

"I honestly do not remember the encounter, it would have been over 30 years ago," the 58-year-old said in a statement. "But if I did behave then as he describes, I owe him the sincerest apology for what would have been deeply inappropriate drunken behaviour."

Rapp, who is starring in Star Trek: Discovery, said the alleged incident happened when Spacey invited him to his apartment for a party.

The now 46-year-old said he had become bored and gone into a bedroom to watch television. Spacey appeared later after the party had apparently ended, the actor said in an interview with Buzzfeed News.