Brain Candy: A Juicy Riddle for your MindBox

Welcome to your inaugural Brain Candy post! Wherein we feed our spreadsheet-withered souls delicious riddles, puzzles, and lateral thinking problems. Let's all get another cup of coffee, wake up our thinking organs, and solve a riddle like the Wednesday-morning badasses we are.

I have high standards for riddles, so I really scraped the bottom of the internet barrel for this first one. It comes to you courtesy of Yahoo Answers user Jeff Rosenspan:

Three men sit in chairs (#1, #2, and #3), in a straight line, all facing north, one behind another. Each man will have a hat placed on his head. No one can see his own hat at any time. The man in Chair #1 is in the front, he cannot see anyone else. The man in Chair #2 is behind Chair #1 and he can only see the man in Chair #1. The man in Chair #3 is behind Chair #2 and he can see both men in Chairs #1 and #2. On the table, there are three blue hats and two white hats. Each of the three men will be randomly given one of those five hats and two will be discarded. No one will know the color of the discarded hats or the color of his own hat. The first person to use logic to determine what color hat is on his own head wins. After five minutes, the man in Chair #1 stands up and says, "I win. I know the color of my hat."

What color was it, and how did he figure it out?

I believe in you, you can do it.

*Beware of the comments, there be spoilers.*