Fred Willard will NOT be prosecuted for lewd conduct ... TMZ has learned, but there are strings attached.
TMZ broke the story ... Willard was arrested Wednesday night at an adult movie theater in Hollywood. Cops claim Willard had his penis in his hand.
Sources tell us ... the L.A. City Attorney is willing to drop any notion of prosecution of Fred, provided he enroll in what's called an Alternative Prosecution Program -- which is a 2-week course on obeying laws relating to the alleged offense.
It's unclear if Willard will play ball. If he does, he won't be prosecuted, but if he doesn't the City Attorney can file charges.