Frederiksen, who served as defence minister from 2016 to 2019, was charged with the rarely used section 109 of the code, which carries a maximum sentence of 12 years in prison, although it was not clear exactly what he was accused of.
Section 109 covers any "person who discloses or imparts any information on secret negotiations, deliberations or resolutions of the state or its rights in relation to foreign states".
A statement published by Frederiksen on Friday did not specify what the charges against him referred to or whether the charges related to his time as a minister.
"I have spoken out as a member of parliament on a political issue, and I have nothing further to add at present. But I could never dream of doing anything that could harm Denmark or Denmark's interests," Frederiksen said in a statement.
It was not clear which comments Frederiksen referred to in his statement.
The state prosecutors office and the Ministry of Defence declined to comment on Frederiksen's statement.
The news come after the head of Denmark's foreign intelligence unit last month was detained, charged under the same section of the law over his suspected involvement in a case of "highly classified" information leaks. Lars Findsen has denied wrongdoing, describing the accusation as "completely insane".