Neil Patrick Harris has apologized for using a transgender slur during a guest-hosting stint Friday on Live With Kelly.

During a segment with Science Bob, Harris and host Kelly Ripa inhaled sulfur hexafluoride, refereed to as “helium's evil twin” by the scientist.

Harris received big laughs from the studio audience when he delivered the line, “It puts the lotion in the basket,” a reference to the transgender villain Buffalo Bill in The Silence of the Lambs.

“I've never sounded more like a tranny in my life,” Harris said after his voice returned to normal. “We can sound like trannies all the time. That would sound hilarious.”

The openly gay, 38-year-old actor apologized for the gaff in a tweet to his over 2 million followers: “Truly sorry for saying the word 'tranny' on Live this week. Twice! Should have been more thoughtful. Didn't at all mean to offend.”

The Gay & Lesbian Alliance Against Defamation (GLAAD) accepted Harris' apology.

“It's heartening to see a celebrity of Harris' stature recognize and apologize for using the slur in such a timely manner, and for greater media attention being paid to its use. Many people do not realize that the word 'tr*nny' is one of the most hurtful and dehumanizing slurs that transgender people hear. Most transgender people associate that word with personal experiences of violence, hatred and derision.”