Yes, the Tor network was originally a spy tool developed by the government. It was made open source so that users wouldn't automatically be recognized as CIA or whatever. I have a feeling you already know this, though.
The feds pay for 60 percent of Tor’s development. Can users trust it?