Chinese Defense Minister Chang Wanquan, standing side-by-side with Hagel, called on the United States to restrain ally Japan and chided another U.S. ally, the Philippines.
Then, Hagel was sharply questioned by Chinese officers at the National Defense University. One of them told Hagel he was concerned that the United States was stirring up trouble in the East and South China Sea because it feared someday "China will be too big a challenge for the United States to cope with."
"Therefore you are using such issues ... to make trouble to hamper (China's) development," the officer said.
Hagel assured the audience that America had no interest in trying to "contain China" and that it took no position in such disputes. But he also cautioned repeatedly during the day that the United States would stand by its allies.
"We have mutual self defense treaties with each of those two countries," Hagel said, referring to Japan and the Philippines. "And we are fully committed to those treaty obligations."
The questioning came just a day after Hagel toured China's sole aircraft carrier, in a rare opening by Beijing to a potent symbol of its military ambitions. Chinese Defense Minister Chang called Hagel, the top civilian at the Pentagon, the first foreign military official to be allowed on board the Liaoning.
Chang and Hagel spoke positively about improving military ties and announced steps to deepen them further. But the effort could do little to mask long-standing tension over of a range of issues, from cyber spying and U.S. arms sales to Taiwan to China's military buildup itself.
Beyond developing an aircraft carrier program, China's People's Liberation Army is building submarines, surface ships and anti-ship ballistic missiles, and has tested emerging technology aimed at destroying missiles in mid-air.
That expansion carries risks as Chinese forces come into greater contact with U.S. forces the Pacific, Hagel said.
"As the PLA modernizes its capabilities and expands its presence in Asia and beyond, American and Chinese forces will be drawn into closer proximity - which increases the risk of an incident, an accident, or a miscalculation," Hagel said in a speech at the National Defense University.
"But this reality also presents new opportunities for cooperation."
The risks of a mishap were highlighted in December when the American guided missile cruiser USS Cowpens had to take evasive action in the South China Sea to avoid hitting a Chinese warship operating in support of the Liaoning.
China's military modernization has also been accompanied by a more assertive posture in its territorial disputes.
China claims 90 percent of the 3.5 million sq km (1.35 million sq mile) South China Sea, where the Philippines, along with other countries, stake claims. China has a separate dispute with Japan in the East China Sea over uninhabited islets that are administered by Japan.
Chang asked the United States to "keep (Japan) within bounds and not to be permissive and supportive", and railed against the government of Japanese Prime Minister Shinzo Abe, who Hagel met in Tokyo last weekend.
"It is Japan who is being provocative against China," Chang told a news conference after talks with Hagel.
"If you come to the conclusion that China is going to resort to force against Japan, that is wrong ... we will not take the initiative to stir up troubles."
Chang called the Philippines a nation "disguising itself as a victim" and renewed its opposition to Manila's pursuit of international arbitration in its territorial dispute.
Hagel, who met the defense minister from the Philippines last week, said he raised U.S. concerns in Beijing over the tension in the South and East China Sea.
He cautioned that no countries should resort to "intimidation, coercion, or aggression to advance their claims."
The U.S. State Department has accused China's coastguard of harassment of Philippine vessels and called an attempt to block a Philippine resupply mission to the Second Thomas Shoal, a disputed atoll, provocative and destabilizing.