Secretary of Defense Chuck Hagel on Saturday accused China of cyberespionage against the U.S., in one of the sharpest rebukes yet targeted at Beijing.

Hagel’s jab drew a wry retort from a Chinese general, who challenged him about America’s growing military presence in Asia.

Addressing a security conference in Singapore, Hagel said the “growing threat of cyber-intrusions,” targeting U.S. government and industry portals, “appear to be tied to the Chinese government and military.”

“We are determined to work more vigorously with China and other partners to establish international norms of responsible behavior in cyberspace,” Hagel said, while delivering the keynote address at the Shangri-La Security Dialogue that he helped form more than a decade ago.

Although this is not the first time the U.S. has accused China of cyber-attacks to steal data from U.S. government and corporate networks, Hagel delivered the rebuke in China’s backyard with a high-level Chinese military delegation in the audience.

Maj. Gen. Yao Yunzhu, director of the Center for China-America Defense Relations at the People's Liberation Army's Academy of Military Science, challenged Hagel minutes after he concluded the speech and began taking questions from the audience, the AP reported.

“Thank you for mentioning China several times,” she told Hagel, amid murmurs and quiet chuckles from the audience, according to the AP.

America's pivot to the Pacific has been widely interpreted as an “attempt to counter China's rising influence, and to offset the increasing military capabilities of the Chinese PLA,” she noted. She also asked Hagel to explain how U.S. military deployments to the region would lead to a better relationship with China.

“That's really the whole point behind closer military-to-military relationships,” Hagel said. “We don't want miscalculations and misunderstandings and misinterpretations. And the only way you do that is you talk to each other.”

Hagel’s remarks came days after newspapers cited a Pentagon report that said designs for many of the nation’s critical advanced weapons systems were compromised by Chinese hackers.

While the Defense Science Board, an advisory group of government and civilian experts, did not hold China responsible for stealing the designs, senior U.S. government officials said most of the data breaches were part of a “widening Chinese campaign of espionage against U.S. defense contractors and government agencies,” according to a Washington Post report.

On Thursday, China’s Defense Ministry dismissed the allegations, saying they were “ridiculous” because the country did not need foreign help for its military development.

Geng Yansheng, a spokeman for the Defense Ministry, said the accusation “both underestimates the Pentagon's defensive security abilities and the Chinese people's intelligence.”

“China absolutely has the ability to build the weapons needed for national security,” Geng told a news briefing, according to Reuters. “Recently China's aircraft carrier, new fighter jets and transport aircraft ... have clearly shown this.”

The accusations and counter-accusations between the two countries precede a summit next week between President Barack Obama and his Chinese counterpart, Xi Jinping.

Obama and Xi are expected to discuss cyber-security, among other issues, during the June 7-8 summit to be held at Sunnylands, a California estate southeast of Palm Springs.