The top U.S. general said on Thursday that the Chinese military was benefiting from the work Alphabet Inc.'s Google was doing in China, where the technology giant has long sought to have a bigger presence.

"The work that Google is doing in China is indirectly benefiting the Chinese military," Marine Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, said during a Senate Armed Services Committee hearing.

"We watch with great concern when industry partners work in China knowing that there is that indirect benefit," he said. "Frankly, 'indirect' may be not a full characterization of the way it really is, it is more of a direct benefit to the Chinese military."

Last year Google said it was no longer vying for a $10 billion cloud computing contract with the U.S. Defense Department, in part because the company's new ethical guidelines do not align with the project.

In June, Google said it would not renew a contract to help the U.S. military analyze aerial drone imagery when it expires, as the company sought to defuse an internal uproar over the deal.

At the same time, Google said it has "no plans" to relaunch a search engine in China, though it is continuing to study the idea.

Lawmakers and Google employees have raised concerns the company would comply with China's internet censorship and surveillance policies if it re-enters the Asian nation's search engine market.

Google Chief Executive Sundar Pichai has previously said the company has invested in China for years and plans to continue to do so, but that the company also was continuing to work with the U.S. government on projects in health care, cybersecurity and other fields.