In 2015, Israeli government hackers saw something suspicious in the computers of a Moscow-based cybersecurity firm: hacking tools that could only have come from the National Security Agency.

Israel notified the NSA, where alarmed officials immediately began a hunt for the breach, according to people familiar with the matter, who said an investigation by the agency revealed that the tools were in the possession of the Russian government.

Israeli spies had found the hacking material on the network of Kaspersky Lab, the global anti-virus firm under a spotlight in the United States because of suspicions that its products facilitate Russian espionage.

Last month, the Department of Homeland Security instructed federal civilian agencies to identify Kaspersky Lab software on their networks and remove it on the grounds that “the risk that the Russian government, whether acting on its own or in collaboration with Kaspersky, could capitalize on access provided by Kaspersky products to compromise federal information and information systems directly implicates U.S. national security.” The directive followed a decision by the General Services Administration to remove Kaspersky from its list of approved vendors. And lawmakers on Capitol Hill are considering a governmentwide ban.

The NSA declined to comment on the Israeli discovery, which was first reported by the New York Times.

Kaspersky said in a statement that “as a private company, Kaspersky Lab does not have inappropriate ties to any government, including Russia, and the only conclusion seems to be that Kaspersky Lab is caught in the middle of a geopolitical fight.” The company said it “does not possess any knowledge” of Israel’s hack.

The firm’s founder, Eugene Kaspersky, said in a blog post last week that his anti-virus software is supposed to find malware from all quarters.

“We absolutely and aggressively detect and clean malware infections no matter the source,” he wrote, suggesting that the NSA hacking tools could have been picked up as malware by the anti-virus program.

In the 2015 case, investigators at the NSA examining how the Russians obtained the material eventually narrowed their search to an employee in the agency’s elite Tailored Access Operations division, which comprises hackers who collect intelligence about foreign targets. The employee was using Kaspersky anti-virus software on his home computer, according to the people familiar with the matter.

The employee, whose name has not been made public and is under investigation by federal prosecutors, did not intend to pass the material to a foreign adversary. “There wasn’t any malice,” said one person familiar with the case, who, like others interviewed, spoke on the condition of anonymity to discuss an ongoing case. “It’s just that he was trying to complete the mission, and he needed the tools to do it.”

Concerns about Kaspersky have also emerged in the cybersecurity industry, where some officials say that the firm’s software has been used not just to protect its customers’ computers but also as a platform for espionage.

Eugene Kaspersky, chief executive of Russia’s Kaspersky Lab. (Pavel Golovkin/AP)

Over the past several years, the firm has on occasion used a standard industry technique that detects computer viruses but can also be employed to identify information and other data not related to malware, according to two industry officials, who spoke on the condition of anonymity to discuss sensitive information.

The tool is called “silent signatures” — strings of digital code that operate in stealth to find malware but which could also be written to search computers for potential classified documents, using keywords or acronyms.

“Silent detection is a widely adopted cybersecurity industry practice used to verify malware detections and minimize false positives,” the company’s statement said. “It enables cybersecurity vendors to offer the most up-to-date protection without bothering users with constant on-screen alerts.”

Kaspersky is also the only major anti-virus firm whose data is routed through Russian Internet service providers subject to Russian surveillance. That surveillance system is known as the SORM, or the System of Operative-Investigative Measures.

The company said that customer data flowing through Kaspersky’s Russian servers is encrypted and that the firm does not decrypt it for the government.

Andrei Soldatov, a Russian surveillance expert and author of “The Red Web,” said, “I would be very, very skeptical” of the claim that the government cannot read the firm’s data. As an entity that deals with encrypted information, Kaspersky must obtain a license from the FSB, the country’s powerful security service, he noted, which “means your company is completely transparent” to the FSB.

It is not publicly known how the Russians obtained the NSA hacking tools in 2015. Some information security analysts have speculated that the Russians exploited a flaw in Kaspersky software to filch the material.

But other experts say the Russians would not need to hack Kaspersky’s systems. They say that the material could be picked up through the country’s surveillance regime.

The firm is likely to be beholden to the Kremlin, said Steven Hall, who ran the CIA’s Russia operations for 30 years. He said that Kaspersky’s line of work is of particular interest to Russian President Vladi­mir Putin and that because of the way things work in Russia, Eugene Kaspersky “knows he’s at the mercy of Putin.”