A spokeswoman for the Düsseldorf court confirmed the release of the German man, who will be charged only with attempted treason.
Prosecutors had been pursuing a case of "preparing a serious act threatening state security" after his employer, the Office for the Protection of the Constitution (BfV), said the agent tried to share "sensitive information" online.
Press reports also said the man, who was 51 at the time, married with children and working at a bank, was planning a bomb attack against the BfV headquarters in Cologne, but no evidence of such a plan emerged.
Reports had also said the man converted to Islam in 2014, and had been gathering intelligence on the Islamist scene in Germany since April 2016.
But he was also allegedly divulging information about the agency under several different names in online chat rooms.