US comedian and actor Kevin Hart says he has stepped down from hosting the 2019 Oscars following a controversy over homophobic tweets.
He said he did not want to be a distraction and that he was "sorry he had hurt people".
The choice of Hart for host was only announced on Tuesday.
But tweets from a decade ago emerged of anti-gay slurs, sparking calls for the Academy of Motion Picture Arts and Sciences to drop him.
Kevin Hart had said hosting the Oscars was "a goal on my list for a long time".
But in a tweet late on Thursday he said he had chosen to step down "because I do not want to be a distraction on a night that should be celebrated by so many amazing talented artists".
He said: "I sincerely apologise to the LGBTQ community for my insensitive words of the past."
I'm sorry that I hurt people.. I am evolving and want to continue to do so. My goal is to bring people together not tear us apart. Much love & appreciation to the Academy. I hope we can meet again.— Kevin Hart (@KevinHart4real) December 7, 2018
Comments Hart made during a comedy routine in 2010 have been put under the spotlight in recent days.
"One of my biggest fears is my son growing up and being gay. That's a fear," he told the audience.
"Keep in mind, I'm not homophobic, I have nothing against gay people, be happy. Do what you want to do.
"But me, being a heterosexual male, if I can prevent my son from being gay, I will."
In 2015, by which time his profile had risen significantly, Hart addressed the stand-up routine in question in an interview with Rolling Stone.
"I wouldn't tell that joke today, because when I said it, the times weren't as sensitive as they are now," he said.
"I think we love to make big deals out of things that aren't necessarily big deals, because we can."
When he revealed he would be the Oscars host earlier this week, Hart said it was the "opportunity of a lifetime for me as a comedian" and that his mother was "smiling from ear to ear right now".
Earlier on Thursday it had appeared he would try to ride out the storm.
In an Instagram post he spoke out against the "negative energy" of the criticism, saying people should "stop searching for reasons to be angry."
He said he was almost 40 years old and was "in love with the man I'm becoming".
View this post on Instagram
Stop looking for reasons to be negative...Stop searching for reasons to be angry....I swear I wish you guys could see/feel/understand the mental place that I am in. I am truly happy people....there is nothing that you can do to change that...NOTHING. I work hard on a daily basis to spread positivity to all....with that being said. If u want to search my history or past and anger yourselves with what u find that is fine with me. I’m almost 40 years old and I’m in love with the man that I am becoming. You LIVE and YOU LEARN & YOU GROW & YOU MATURE. I live to Love....Please take your negative energy and put it into something constructive. Please....What’s understood should never have to be said. I LOVE EVERYBODY.....ONCE AGAIN EVERYBODY. If you choose to not believe me then that’s on you....Have a beautiful day
In a later video, he said he had been called by the Academy and asked to apologise or another host would be found.
"I chose to pass. I passed on the apology," he said, repeating his assertion that the issue of the tweets had been addressed in the past.
He appeared to later change his mind and issue an apology as he stood down.
Parks and Recreation actor Billy Eichner welcomed the news on Twitter.
"As one of very few openly gay men in comedy who's fortunate enough to work as much as I do, I will always fight for my LGBTQ community to get the respect we deserve," he said.
I’m no saint. We just wanted a little understanding, a little explanation. Apologies are tough - they leave you vulnerable. Toxic masculinity is real. I deal with it in my own way too. So on that note, I appreciate @KevinHart4real apologizing. And apology accepted. That’s all.— billy eichner (@billyeichner) December 7, 2018
But others online expressed disappointment about Hart stepping down, including former Golden Globes host Ricky Gervais.
The only time I'm offended by a comedian is when they apologise.— Ricky Gervais (@rickygervais) December 7, 2018
Who might take over?
Actress Busy Philipps wasted no time in suggesting she should host the ceremony instead.
Failing that, she said, any female host would be preferable.
The Oscars has been hosted by women before - such as Ellen DeGeneres and Anne Hathaway, who co-anchored with James Franco.
Living for this drama. Who’s next up to the plate to take a swing at hosting this year? Kate McKinnon? Eric Andre? Ellen DeGeneres again? I feel like @Lin_Manuel is the obvious choice here though. #Oscars2019 https://t.co/6JmVOztJrC— Becky Kralle (@beckykralle) December 7, 2018
But potential new hosts may be reluctant to take on the job.
The role has thrown up problems for a number of past hosts and the Hollywood Reporter has called it "the least wanted job in Hollywood".
The Oscars will take place in Los Angeles on 24 February 2019.