NEW YORK (Reuters) - Creators of the U.S. television show “Family Guy” did not infringe copyright when they transformed the song “When You Wish Upon a Star” for comical use in an episode, a U.S. judge ruled on Monday.

Animated characters Stewie (L) and Brian from the series 'Family Guy' are shown on the screen at the 59th Primetime Emmy Awards in Los Angeles, California September 16, 2007. REUTERS/Mike Blake

Music Publisher Bourne Co., the U.S. copyright owner of the song made famous in Walt Disney’s “Pinocchio,” sued Fox Broadcasting Co., creator Seth MacFarlane and producers in October 2007 for copyright breach.

The lawsuit said the song “I Need a Jew,” featured in one of the animated show’s episodes, was a thinly veiled copy of the music from ‘When You Wish Upon a Star’ coupled with “new anti-Semitic lyrics” and had done damage to the original.

But U.S. District Judge Deborah Batts ruled that the lyrics and tone of the song used in “Family Guy” were “strikingly different.”

The judge also said it was fair for it to be imitated for humorous effect since the music publisher had benefited from the song’s association with other more “wholesome” shows like “Pinocchio.”

“It is precisely that beneficial association that opens the song up for ridicule by parodists seeking to take the wind out of such lofty, magical, or pure associations,” she said.

The song, by composer Leigh Harline and lyricist Ned Washington, was introduced in 1940 in the movie “Pinocchio” and won an Academy Award for Best Original Song that same year. It has been recorded by more than 100 artists and orchestras.

Fox, owned by Rupert Murdoch’s News Corp, initially did not distribute the controversial “Family Guy” episode in recognition of how offensive it was, the suit claimed.

It was eventually broadcast on the Cartoon Network in 2003 and has run at least 36 times in syndication and reruns.

Bourne Co. did not return a call seeking comment.