The nation’s top military officer slammed Google for working with China, which he said benefitted its military, during a hearing on Capitol Hill Thursday.

“The work that Google is doing in China is … indirectly benefitting the Chinese military,” Dunford told the Senate Armed Services Committee during a hearing on the 2020 defense budget.

“In fact, the way I describe it to our industry partners is, ‘Look, we’re the good guys. And the values that we represent, and the system that we represent is the one that will allow you, and has allowed you, to thrive,” he added.

“We watch with great concern when industry partners work in China knowing that there is that indirect benefit. And frankly, ‘indirect’ may be not a full characterization of the way it really is, it’s more of a direct benefit to the Chinese military.”

Last June, Google canceled a project working with the Pentagon to help develop artificial intelligence capabilities, due to concerns from employees that their work could go towards warfighting in the future. However, last January, Google opened an artificial intelligence research center in Beijing.

“Five trillion of their economy is state-owned enterprises. So the technology that has developed in the civil world transfers to the military world, it’s a direct pipeline,” said Acting Defense Secretary Patrick Shanahan, who also testified.

“Not only is there a transfer, there is systemic theft of U.S. technology that facilitates even faster development of emerging technology,” he added.

Dunford’s comments came in response to questioning from Sen. Josh Hawley (R-MO) during the hearing, which was on the Defense Department’s fiscal year 2020 budget request, which is geared towards meeting challenges from China and Russia.

Hawley, who has taken on the fight against Big Tech companies in the Senate, called it “extraordinary” that Google — an American company based in the U.S. — would refuse to work with the U.S. military while benefitting the Chinese military.

“We are in a struggle with the Chinese government over whether or not they’re going to become a regional or maybe global hegemon with values very different from ours, certainly values that do not favor freedom in the world, and we have an American company that does not want to do work with our Defense Department, which is one thing, but they’re happy to help [the] Chinese military at least indirectly,” he said.

“I think that’s just extraordinary,” he added.

Must watch video: Joint Chiefs Chairman says Google refuses to work with US military but provides “direct benefit” to China’s military pic.twitter.com/MadQVJQK4a — Josh Hawley (@HawleyMO) March 14, 2019

Shanahan also testified that China was catching up to the U.S. in terms of defense spending.

“China’s defense spending approaches that of the United States, when we take into account purchasing power and the portion of our budget going to military pay and benefits. That, coupled with China’s organized approach to steal foreign technology, has allowed China to modernize its missile, space, and cyber capabilities, as well as project power far beyond its borders,” he said.

Out of the Pentagon’s $718 billion budget request for fiscal year 2020, $156 billion would be spent on military personnel.

Shanahan implored U.S. tech companies to support the U.S., not China.

“The talent is in this country, we need to use the talent in this country and the talent in this country needs to support our great power competition,” Shanahan said.