United Water spokesman Rich Henning says 26-year old Asef Mohammad broke into the plant that treats and pumps water for the township.
He then somehow climbed into a 24 inch pipe and became stuck in the pipe.
Mohammed's parents tell police he left at 2 a.m. in shorts and a jacket and he never came back.
Rescue crews were able to remove sections of the pipe and pump in fresh air and heat as they performed the rescue and freed him at about 11 a.m.
"One of the workers came in this morning and heard someone screaming for help and walked over and found the person stuck inside," said Captain Michael Fountain with the Manalapan Police Department.
Police say they are very familiar with Mohammed but do not know why he climbed into the pipe.
Officials stress that this was a drain pipe that has no impact on drinking water.
Mohammed was charged with fourth-degree trespassing, and officials are reviewing surveillance video to see how he got stuck in the pipe.