Seth Macfarlane made Kevin Spacey molestation joke in 2005

Seth Macfarlane has once again inadvertently predicted the downfall of another Hollywood star.

The actor and comedian wrote a joke for his popular cartoon Family Guy, in which one of the main characters - a baby - is dared to run through a mall yelling "Help! I've escaped from Kevin Spacey's basement!"

That episode aired in 2005 - 12 years before Spacey was accused of molesting a 14-year-old at a party he hosted in 1986, when he was 26.

Star Trek: Discovery actor Anthony Rapp alleges Spacey picked him up and carried him to bed after the party, in what he believed was an attempt to "seduce" him. Spacey is then accused of laying on top of Rapp, leaving him trying - ultimately successfully - to "squirm away".

The resurfacing of Macfarlane's Family Guy joke shows he is adept at making jokes about celebrities' private lives that have at least some element of truth.

In 2013, Macfarlane made a quip about Harvey Weinstein at the Oscars that was widely shared amid the emergence of dozens of accusations of sexual assault and harassment against female colleagues.

After reading out the nominees for best supporting actress, he finished by saying "Congratulations, you five ladies no longer have to pretend to be attracted to Harvey Weinstein."

Following the re-emergence of that joke, Macfarlane confirmed he had heard about Weinstein's alleged misconduct through friend Jessica Barth, and felt compelled to joke about it.

"Make no mistake, this came from a place of loathing and anger. There is nothing more abhorrent and indefensible than abuse of power such as this," he wrote in a Twitter post.

Macfarlane has not commented on the origins of the Kevin Spacey joke.