(Reuters) - Comedian Kevin Hart stepped down on Thursday from hosting the 2019 Oscar ceremony after “insensitive words” about gays he tweeted in the past resurfaced online.

The 39-year-old comedian and “Ride Along” actor had announced on Tuesday that he would host the Academy Awards, the film industry’s highest honors.

“I have made the choice to step down from hosting this year’s Oscar’s ... this is because I do not want to be a distraction on a night that should be celebrated by so many amazing talented artists,” Hart said in a tweet late on Thursday.

“I sincerely apologize to the LGBTQ community for my insensitive words from my past,” he tweeted.

In one of the old tweets, Hart described an actor’s picture as a “gay billboard for AIDS”. In another he said if his son were playing with a doll’s house, he would break it over his head and tell him to stop being gay.

The Academy of Motion Picture Arts and Sciences, which organizes the Oscars, was not immediately available for comment.

Chad Griffin, the president of the Washington DC-based LGBTQ advocacy group, The Human Rights Campaign, responded to Hart on Twitter late Thursday.

“You have a rare opportunity to take responsibility, teach people in this moment, & send a message to LBGTQ youth that they matter & deserve dignity & respect,” Griffin wrote.

Hart, who also starred in the 2017 film “Jumanji: Welcome to the Jungle”, would have followed talk show host Jimmy Kimmel who hosted the Oscars in 2018 and 2017.

Hart, writing on his Instagram page this week, called the gig “the opportunity of a lifetime”.

“I am so happy to say that the day has finally come for me to host the Oscars,” he said.

The Academy responded on Twitter: “Welcome to the family.”

Hosting the Oscars is one of the most prestigious and difficult jobs in show business, navigating the expectations of the A-list audience in the theater and millions of people watching on television, with a combination of topical and insider jokes.

Hart, who is African-American, would have been one of just a handful of black Oscar hosts over the past 90 years, including Chris Rock, Whoopi Goldberg and Sammy Davis Jr.

Oscar nominations will be announced on Jan. 22, with the 2019 televised ceremony taking place in Hollywood on Feb. 24.