The United States should also withdraw charges against two Chinese citizens, the ministry said, adding that China had never participated in or supported any stealing of commercial secrets and had lodged "stern representations" with Washington.
"We urge the U.S. side to immediately correct its erroneous actions and cease its slanderous smears relating to internet security," it said, adding that it would take necessary measures to safeguard its own cybersecurity and interests.
It has long been an "open secret" that U.S. government agencies have hacked into and listening in on foreign governments, companies and individuals, the ministry added.
"The U.S. side making unwarranted criticisms of China in the name of so-called 'cyber stealing' is blaming others while oneself is to be blamed, and is self-deception. China absolutely cannot accept this."
U.S. prosecutors indicted two Chinese nationals linked to China's Ministry of State Security intelligence agency on charges of stealing confidential data from American government agencies and businesses around the world.
Prosecutors charged Zhu Hua and Zhang Shilong in hacking attacks against the U.S. Navy, the space agency NASA and the Energy Department and dozens of companies. The operation targeted intellectual property and corporate secrets to give Chinese companies an unfair competitive advantage, they said.
The pair were members of a hacking group known within the cyber security community as APT 10 and also worked for a Tianjin company Huaying Haitai Science and Technology Development Co, prosecutors said.
Reuters was unable to locate immediately contact details for Zhu or Zhang.
Corporate records show Huaying Haitai is registered at an address in a non-descript yellow office tower complex in the southern fringes of Tianjin, which is about an hour's drive southeast of capital Beijing.
A woman who answered the door to the small unmarked office told Reuters she worked for an advertising company which had only moved in months earlier.
She confirmed the previous occupants were a company called Huaying Haitai, but said she was unsure what they did.
Britain, Australia and New Zealand joined the United States in slamming China over what they called a global campaign of cyber-enabled commercial intellectual property theft, signalling growing global coordination against the practise.
China's Foreign Ministry said Britain and other countries had also made "slanderous comments" stemming from "ulterior motives".
Five sources familiar with the attacks told Reuters the hackers breached the networks of Hewlett Packard Enterprise Co and IBM, then used the access to hack into their clients' computers. IBM said it had no evidence that sensitive data had been compromised. HPE said it could not comment.
Chinese Foreign Ministry spokeswoman Hua Chunying told reporters she noted IBM's statement that it had no evidence sensitive data had been compromised.
Certain people in the United States have taken to regular slandering of China, Hua told reporters.
"Perhaps they think that if they repeat a lie 1,000 times it becomes the truth. But I want to tell them that it's still a lie even if repeated 10,000 times."
China-U.S. ties in recent months have also been affected by a protracted trade war, though there is currently a truce as both countries try and work out a resolution.
Asked whether China's anger over the cyber accusations would impact upon China-U.S. trade talks, Hua reiterated a line from the ministry's statement earlier in the day that if the United States did not mend its ways then relations would be seriously harmed.
Adding to the tensions, on Thursday China denounced a new U.S. law related to Tibet.
The official China Daily wrote in an editorial on Friday that the new Tibet-related legislation added an "additional flashpoint" to already rocky relations.
"With Washington favouring a confrontational approach aimed at maintaining its hegemony rather than a cooperative one for the common good, Beijing will have to be prepared to stand its ground and respond as necessary to safeguard its core interests."
The Australian foreign affairs and home affairs departments said in a statement that APT 10 was engaged in "sustained cyber intrusions" on large managed service providers (MSPs), or information technology contractors globally.
"Australia calls on all countries, including China, to uphold commitments to refrain from cyber-enabled theft of intellectual property, trade secrets and confidential business information with the intent of obtaining a competitive advantage," the joint statement said.
An Australian government source said the Chinese had breached "a small number" of targets but the extent of the attack was unclear.
"We may never know how many companies were impacted," said the source, who spoke on condition of anonymity because he was not authorised to comment on the attacks. "We've informed those caught up but we need others to make urgent checks."
Nick Savvides, chief technology officer for cybersecurity provider Symantec Corp in Asia Pacific, said in an email that cyber espionage had become "overt in recent years".
"Attackers are getting clever, hiding in plain sight by using tools and techniques already installed on targeted computers, making them difficult to detect," he added in the email which did not mention China.
(Reporting by Philip Wen; Additional reporting by Ben Blanchard, Zhang Min, Colin Packham and Byron Kaye; Editing by Paul Tait and Michael Perry)
By Philip Wen