'Discovery' Gunman Ordered to Mental Institution in '08

9/1/2010 3:00 PM PDT

'Discovery' Gunman Ordered to Mental Institution in '08

James Jay Lee -- the gunman currently holed up with hostages at Discovery Channel headquarters -- was ordered to a mental institution after a 2008 environmental protest ... TMZ has learned.

Lee was arrested for disorderly conduct during his protest outside Discovery headquarters in Maryland two years ago -- after allegedly trying to draw a crowd by throwing money all over the sidewalk.

Lee was found guilty of disorderly conduct -- and the court ordered him to serve time in a mental institution.

But according to sources, Lee never stepped inside a hospital -- we're told he was released after 14 days in a local jail ... and got off with 2 years supervised probation.