Think of the last place you'd expect to see Jamie Foxx getting turnt -- and you still wouldn't guess Whitefish, Montana ... but that IS where he made a surprise performance.
Jamie ruled the crowd at Casey's bar in the tiny mountain town on Saturday night ... jumping on stage after dinner with the owner of the establishment.
Jamie kept the audience participation part of the night simple -- I say Whitefish, you say Montana!
Whitefish is a favorite getaway spot for Hollywood celebs -- and Knicks Pres. Phil Jackson calls it home -- but fair to say the 7,000 residents have never heard anyone yell, "Put it in your mouth! I got these bitches screaming Django in the house!"