LOS ANGELES — Kevin Spacey says he's "beyond horrified" by allegations that he made sexual advances on a teen boy in 1986.

The actor posted on Twitter that he doesn't remember the encounter but apologizes for the behavior.

Kevin Spacey attends the 'Elvis & Nixon' world premiere screening during the 2016 Tribeca Film Festival.

"I owe him the sincerest apology for what would have been deeply inappropriate drunken behavior, and I am sorry for the feelings he describes having carried with him all these years," Spacey wrote.

Star Trek: Discovery actor Anthony Rapp tells BuzzFeed he was 14 when he attended a party at Spacey's apartment. He says an inebriated Spacey placed him on a bed and climbed on top of him but he was able to leave before the encounter could go further.

Rapp — now 46 — says he came forward after allegations against producer Harvey Weinstein were publicized. The disgraced movie mogul has been accused of sexually harassing, abusing and raping 60 women.

On Twitter, Spacey, now 58 and a two-time Oscar winner, said publicly for the first time that he is gay.

"I know that there are stories out there about me and that some have been fueled by the fact that I have been so protective of my privacy," he wrote. "As those closest to me know, in my life I have had relationships with both men and women. I have loved and had romantic encounters with men througout my life, and I choose now to live as a gay man." 

He added: "I want to deal with this honestly and openly and that starts with examining my own behavior."

Reaction on Twitter was swift and negative, with many criticizing Spacey for describing an assault on a child as drunken behavior.

Billy on the Street host Billy Eichner was having none of it: "Nope," he wrote.

Rose McGowan, one of Weinstein's most vocal accusers, pointed out that the focus should be the actor who said he was the victim, rather than Spacey's sexuality.

"You do not get to 'choose' to hide under the rainbow," comic Wanda Sykes wrote.

Contributing: The Associated Press