30 Rock may have just been five years ahead of the rest of the world. The beloved NBC sitcom, which ran from 2006 to 2013, made reference to Bill Cosby's dark past five years before the media and general public caught up this fall.

Unearthed by Crushable's Jenni Maier, a March 2009 episode called "The Bubble" makes Cosby the butt of an off-color joke. 

In the episode, which stars Jon Hamm as cameo character Drew Baird, Tracy Jordan (Tracy Morgan) is causing problems for Jack Donaghy (Alec Baldwin), and needs to be convinced to return to the fictional TGS show, which is run by Liz Lemon (Tina Fey). 

One of Jack's various attempts to win Tracy over involved a phone call to the star from one of his "childhood idols." Bringing Liz into his office, Jack also enlists Rick from accounting (comedian Godfrey). 

Impersonating Cosby, now 77, Rick says in Cosby's voice, "Tracy, this is Bill Cosby… I want you to come back to the TGS for the people who like the jokes and the things."

"Bill Cosby, you got a lot of nerve getting on the phone with me after what you did to my Aunt Paulette!"

"I think you’re confusing me with someone else," Rick as Cosby says.

"1971," Tracy shoots back. "Cincinnati. She was a cocktail waitress with the droopy eye!"

Allegations of sexual abuse and rape against Cosby have, in fact, come out from that very year, and multiple women have made claims of misconduct that they said took place in the early 1970s. 

"I'm the guy… with the pudding…" Rick as Cosby continues in the 30 Rock clip.

"Don’t try to tell me what to do!" Tracy retorts, going on to invoke the name of the disgraced comedian's character on The Cosby Show. "Dr. Heathcliffe Huxtable, with your light-ass kids! Jack! Why would you make me talk to this man?"

The NBC show also has another tie to the scandal surrounding the actor. The current backlash against Cosby was prompted by former 30 Rock writer Hannibal Buress' October stand-up set, in which he called Cosby a "rapist" and brought up the 13 women who said he acted inappropriately with him. 

Watch the moment from 30 Rock in the video above.