The report is one of the first public indications that Chinese hackers have had years of access to U.S. infrastructure.

Chinese hackers have at times secretly hidden in U.S. infrastructure for up to five years, ready to conduct a potentially destructive cyberattack if the two countries were to go to war, federal agencies said Wednesday.

The claim was published in a public cybersecurity warning, one of the largest and starkest of its kind, from six U.S. agencies, as well as allied cybersecurity and intelligence agencies from Australia, Canada, New Zealand and the U.K.

Over the past year, U.S. officials have repeatedly issued warnings that hackers working for China’s intelligence services keep gaining stealthy access to U.S. infrastructure. They feared such access could turn into a destructive cyberattack in the event of a major conflict, like China invading Taiwan, as the U.S. has said it would come to Taiwan’s aid.