An Army Special Forces soldier who admitted to stockpiling military-grade explosives outside his home near Fort Campbell was released from jail into the custody of his wife.

U.S. Magistrate Judge Cliff Knowles gave the order releasing 25-year-old Sgt. 1st Class Timothy Ryan Richards during a detention hearing Thurday in federal court in Nashville. He was charged with possessing two unregistered automatic weapons.

As part of the conditions for his release, Knowles ordered Richards not to be around any weapons or leave the area unless it was authorized by the military.

Investigators are still trying to determine whether he got the explosives from the post.

Two hunters stumbled upon the explosives on Sunday at Richards' home outside of Clarksville, near the sprawling Army post on the Tennessee-Kentucky state line.