The mutual threat of China's pervasive hacking, combined with military belligerence, has led the United States military to extend protection to Japan, helping the Asian state protest against attacks against military bases and infrastructure such as power grids.
The agreement was announced in a joint statement on Saturday.
"We note a growing level of sophistication among malicious cyber actors, including non-state and state-sponsored actors," said the two countries in a prepared statement.
Cybersecurity is one of the big areas in which Japan and the United States are deepening their military partnership, the framework of which was agreed in April. The agreement also stipulates that the two will integrate their ballistic missile defense systems, while making Japan the primary partner in the Asian theater.
The United States has been investing heavily in building a force to protect and retaliate against online attacks, while Japan has been slower in taking such steps.
Japan's military cyber defense unit has just 90 members, while the U.S has more than 6,000 people at the Pentagon - on record. Many more hires lurk as contractors or black budget employees that aren't included in the number.
China's Defense Ministry denounced the new strategy, saying, bizarrely, that it would worsen tension over Internet security.
Yet China appears to be the main world threat to cyber security, running a persistent and sophisticated hacking program the siphons personal information, industrial designs, military secrets and anything else it can find. Most recent modern hack attacks have been attributed to China, which has prompted a world-wide reaction to the aggressive behavior.