Hit US series 30 Rock has mocked cast-member Tracy Morgan for his ill-judged gay jokes last summer.

Morgan was forced to publicly apologise for a routine at a gig in Nashville which “shocked” audience members.

The comedian admitted going too far with the remarks, which included saying he would stab his son to death if he came out as gay.

Morgan, 43, plays erratic comedic actor Tracy Jordan on the programme, which revolves around the production of a weekly sketch show, TGS.

In last night’s episode, Morgan’s character makes some ill-considered gay comments during a performance and has to make amends.

But Jordan mistakenly apologises to Glad, a Californian bin bag company, rather than GLAAD, the Gay & Lesbian Alliance Against Defamation.

The show’s lead writer Liz Lemon, played Tina Fey, takes Jordan to task, saying: “Look, you’re a public figure. Believe it or not, the dumb things you say may influence or hurt people.”

Lemon also asks him whether he realises how many of his co-workers are gay.

She tells the fictional media: “He’s not capable of hate. He’s just an idiot who doesn’t know what he’s saying.”

Last year, Morgan said: “I want to apologise to my fans and the gay and lesbian community for my choice of words at my recent stand-up act in Nashville.

“I’m not a hateful person and don’t condone any kind of violence against others. While I am an equal opportunity jokester, and my friends know what is in my heart, even in a comedy club this clearly went too far and was not funny in any context.”