Kevin Hart, who previously faced backlash over remarks deemed homophobic, is coming under fire for comments he made to Lil Nas X as the rapper explained why he waited to publicly come out as gay.

In an episode of HBO Sport's "The Shop: Uninterrupted," the rapper was asked about his coming out, which he did in a tweet on the last day of Pride Month in June as his song "Old Town Road" topped the country charts. The song stayed atop the Billboard Hot 100 list for a record-smashing 19 weeks.

Before Lil Nas X could offer an explanation, Hart chimed in to ask: "He said he was gay, so what?"

The rapper, whose real name is Montero Lamar Hill, was then asked why he felt it was necessary to publicly reveal his sexuality. Lil Nas X told the group of men which included Hart and athletes Rob Gronkowski and Kevin Love among others, that growing up he was taught to "hate" homosexuality.

"Why you growing up to hate it?" Hart asked the rapper.

Lil Nas X performs on stage during Internet Live By BuzzFeed at Webster Hall on July 25, 2019 in New York. Noam Galai / Getty Images for Buzzfeed file

"C'mon now. If you really from the hood, you know," Lil Nas X responded, referring to the stigma against homosexuality in the black community.

The rapper then explained that he chose to come out because he was already at the top of his game and had nothing to gain from it.

"If you're doing this while you're at the top, you know it's for real and it's showing it doesn't really matter," he said.

Hart's comments as Lil Nas X tried to share his story angered many people on social media, some of whom accused the comedian of being dismissive or gaslighting the rapper.

Kevin Hart acting like he doesn’t know why Lil Nas X would be scared to come out is like someone who stole the thing you lost helping you look for it. https://t.co/ZmfRNMktel — Phillip Henry (@MajorPhilebrity) September 4, 2019

Kevin Hart really thought he could rattle Lil Nas X, a veteran of Barb twitter — JuanPa (@jpbrammer) September 4, 2019

"He said he was gay. So what!" Kevin Hart knows exactly what the "so what" is here and why a young black boy would closet his sexuality until he believed it was safe. Why not simply listen, give @LilNasX the space and deference to tell his own story... https://t.co/8nY9cHPftP — G O L D I E. (@goldietaylor) September 4, 2019

Kevin Hart really tried to sit here & gaslight Lil Nas as if he didn’t understand why coming out as a Gay Black Man with a #1 isn’t monumental. Same man who’s a homophobe. Knowing our community are huge hypocrites w/ homophobia but hate oppression. His mind twisted like his back. https://t.co/tXNAf5Mn8o — Ronnie 🌹 (@9inewaves) September 4, 2019

Whew, the gaslighting from Kevin Hart. I keep telling y’all; trash in, trash out. Anyway, I’m so proud of @LilNasX. His calm confidence is impressive. https://t.co/eO1MpEs3B1 — Saeed Jones (@theferocity) September 4, 2019

Others on social media reminded Hart that he stepped down as host of the 2019 Oscars after his old homophobic tweets and jokes resurfaced.

In his 2010 comedy special "Seriously Funny." Hart joked that his biggest fear was his son being gay. "As a heterosexual male, if I can prevent my son from being gay, I will," he told the audience.

In several tweets, some of which have now been scrubbed from his Twitter account, Hart called people "gay" and used homophobic slurs, including calling someone a "fat faced f-g."

Kevin Hart didn’t learn from his past clearly. They didn’t let him host the oscars because of his past remarks . Why they set lil nas x up like that is tragic . He handled it so well — Tyler Templeton (@TylerTempleto13) September 4, 2019

I respect lil Nas x for not launching Kevin Hart across the room. How are you going to act like homophobia in the black community doesn't exist when you dropped out of hosting the Oscars last year because you were being homophobic https://t.co/kiAWer4u4x — spiderman stan account (@BiancaJelani) September 4, 2019

In a December 2018 tweet, the comedian and actor apologized for his past comments and announced that he was pulling out as host.

The new wave of backlash against the comedian comes on the heels of Hart being hospitalized with major back injuries after he was involved in a car crash over the weekend. His wife, Eniko, said he's expected to make a full recovery.