origin of phrase "the shit hit the fan"

does anyone know the origin of the phrase “the shit hit the fan?”

It’s an expression to describe a situation similar to having shit hitting an electric fan. I doubt anyone kept a fan under an outhouse or anything, but I think it’s just a colorful way of describing a major fuckup that went suddenly awful.

I’ve heard it dates from a joke in the late nineteenth or early twentieth century about a traveler staying in an inn. Probably a country rube of some sort, since the joke hinges on the need to relieve himself and using a hole in the floor of his room for that purpose, believing it to be much like his beloved outhouse back home.
Unfortunately it turns out to be a hole in the ceiling of the inn’s parlor, directly below which was an electric fan. He hears the commotion below and runs downstairs to see what’s happened. He may be a rube but he figures this out pretty quickly, and sneaks back upstairs without anyone noticing he’s been there.
At breakfast the next morning he’s feeling pretty smug about the whole deal and sits down with several other guests at a large table.
A few pleasantries are exchanged, then the topic of last night’s incident is brought up again. “So,” one guest said, turning to the newcomer, “Where were you when the shit hit the fan?”

More a humorous anecdote than something with a punchline, but then again it’s a gem, considering the expression’s been with us ever since.

‘A nasty angry reaction when some deed goes undone or a bad situation becomes known to those in charge; everybody catches hell.—(1930’s.) James Jones (1951.) From Here to Eternity. “Those things are going to have to be separated for size,” he said…“They already been separated,” Warden said, without looking up. “Where were you when the shit hit the fan?”’

From http://www.geocities.com/PicketFence/7608/sayt.htm

I don’t think this contradicts Olentzero.

Thanks Wonko, Olentzero and Sofa King for the speedy responses!
esquiline

Dad used to say, “The feces hit the rotating oscillator.”

(Although “oscillating rotator” might be more accurate.)

I prefer to say “when the fit hit the shan.”

I also wonder why people look at me funny sometimes.