COPENHAGEN (Reuters) - Russia has hacked the Danish defense and gained access to employees’ emails in 2015 and 2016, NATO member Denmark’s defense minister told newspaper Berlingske on Sunday.

A man types on a computer keyboard in Warsaw in this February 28, 2013 illustration file picture. REUTERS/Kacper Pempel/Files

The report comes at a time when several Western governments, including the United States, France and Britain, have accused Russia of resorting to hacking to influence elections -- allegations Moscow has repeatedly dismissed as baseless.

A report from the Danish Defense Intelligence Service’s unit for cyber security said “a foreign player” had spied against Danish authorities and gained access to non-classified documents.

It did not name the country behind the espionage, but Foreign Minister Claus Hjort Frederiksen told Berlingske it was Russia.

“It is linked to the intelligence services or central elements in the Russian government, and it is a constant battle to keep them away,” Frederiksen told the newspaper.

A spokeswoman from the Danish Defense Ministry confirmed that the minister had been quoted correctly but said he would give no further comments for the time being.

Spokespeople at the Kremlin were not available to comment on Sunday.

Frederiksen told Berlingske the hacking had been possible due to insufficient security around emails with non-classified material, something that has since been improved.

The group behind the attack went under the name APT28 or Fancy Bear and was one of two groups which allegedly gained illegal access to U.S. democrats’ emails last year, according to Berlingske.

Frederiksen said in January that Denmark plans to increase military spending in response to Russian missile deployments in the Baltic region that it perceives as a threat.