MOSCOW — The Kremlin on Monday denied accusations that “key elements” of the Russian government had hacked into email accounts at Denmark’s Defense Ministry over the last two years in a sustained cyberattack.

A new report by the Danish government’s Center for Cybersecurity said that hackers had breached email accounts and servers at both the Defense Ministry and the Foreign Ministry in 2015 and 2016. The hackers gained access to login information but did not obtain any classified information from the compromised Defense Ministry accounts, the report said.

Denmark faces a “very high” threat of cyberespionage against both the government and private companies, according to the report from the center, an arm of the Danish Defense Intelligence Service. It emphasized that the attacks were all connected and part of a constant threat.

Although the report, made public on Sunday, did not name Russia, Defense Minister Claus Hjort Frederiksen blamed Moscow in his remarks to the Danish news media.