In this Oct. 8, 2012 photo, a man walks near company logos at a R&D center of Huawei Technologies Inc. in Wuhan, in central China's Hubei province. (AP/AP)

China on Tuesday slammed as “groundless” a congressional report that called two Chinese telecom companies a threat to U.S. national security.

The report, released Monday by the House Intelligence Committee, warned that the U.S. government and American companies should stop buying equipment from Huawei and ZTE — two of China’s largest telecom firms — because they are loyal to the Chinese government and could be used in the future as a tool for Chinese spying.

The allegations provoked strong public reactions by Chinese officials.

“It is based on subjective speculation and false foundations,” Shen Danyang, a spokesman for China’s Commerce Department, said in a written statement.

Shen also argued that the United States had violated its free-market principles and put at risk future cooperation between the United States and China. “I hope the United States will abandon its discrimination against Chinese companies.”

Hong Lei, a spokesman for China’s foreign ministry, also defended both companies.

“Chinese telecommunications companies have conducted their international operations based on market-economy principles,” Hong said. “Their investments in the U.S. reflect the mutual benefits brought about by U.S.-China trade relations. We hope the U.S. Congress will put aside its prejudice, respect the facts and do more to promote China-U.S. trade relations, not the opposite.”

China’s state-run media struck back with anger, putting the issue on several front pages. The government-run Xinhua News Agency said the report was “based on wild guesses” and blamed its conclusions on a “Cold War mentality as well as protectionism.”

The nationalistic Global Times newspaper accused the United States of seeking to block Huawei to protect American firms from a competitor — a turnabout of one of the most common complaints about the Chinese government.

“Washington is afraid that Chinese companies will bring competition and challenges to the U.S. Its lack of self-confidence is astonishing,” read one Global Times article.

The dust-up with China comes amid a U.S. presidential race in which both sides have tried to appear strong and willing in standing up to China. That has led to several harsh statements on China and criticism of President Obama by Republican challenger Mitt Romney, and a string of recent actions from Obama designed to counter Romney’s charges that he has been soft.

One Obama ad — released shortly after the congressional report — attempted to tie Romney to Huawei through the Republican’s former firm Bain Capital.