Defense Secretary Chuck Hagel, pushing for openness ahead of a trip to China, said Friday in an unusual live broadcast from a secretive base that the Pentagon would exercise restraint in using the military in cyberspace and urged other nations to do so as well.

In his first remarks on cybersecurity since becoming defense secretary last year, Hagel told a retirement ceremony for Cyber Command chief Gen. Keith Alexander that the Pentagon sought to be "open and transparent" about its cybercapabilities and intentions with both allies and competitors.

"The United States does not seek to militarize cyberspace," Hagel told an audience at Fort Meade, Maryland, home of Cyber Command and the NSA signals spy service.

He said the U.S. wants to promote the qualities of the Internet that have made it a "catalyst for freedom and prosperity."

The speech was seen as an effort to ease strains and shape the dialogue over cyber issues ahead of his trip, which follows recent reports that the NSA for years accessed the networks of Chinese telecommunications giant Huawei.

Hagel's remarks come as the Pentagon is in the process of beefing up its force dealing with cybersecurity, expanding it from about 1,800 people today to more than 6,000 by the end of 2016.