US Secretary of Defense Chuck Hagel speaks during a press conference at the Pentagon on March 26, 2014 in Washington

The United States will show "restraint" in cyber operations outside of US government networks, Secretary of Defense Chuck Hagel said Friday, urging other countries to do the same.

Hagel, speaking at the National Security Agency (NSA) headquarters at Fort Meade, Maryland, said that the Pentagon "does not seek to 'militarize' cyberspace."

Instead, Hagel said that the US government "is promoting the very qualities of the Internet –- integrity, reliability, and openness -– that have made it a catalyst for freedom and prosperity in the United States, and around the world."

The remarks came at the retirement ceremony for outgoing NSA chief, General Keith Alexander.

The Pentagon "will maintain an approach of restraint to any cyber operations outside the US . We are urging other nations to do the same," Hagel said.

He also said that the United States "will continue to take steps to be open and transparent about our cyber capabilities" with Americans, US allies, "and even competitors."

The idea is to "use the minimal amount of force possible" in cyber operations, a senior defense official told reporters, speaking on condition of anonymity.

This would take place only when it would "either prevent conflict, de-escalate conflict or allow us to use the minimal amount of force," the official said.

"That is not always the approach that other nations in the world use," the official said.

Although he emphasized that there was "a clear difference" between espionage and cyber operations, restraint is also applicable "for espionage and communications intelligence" at both the NSA and Cyber Command, the official said.

"We think very carefully about the things we do outside of our own network," the official said.

The budget for the Pentagon's Cyber Command for fiscal 2015 is $5.1 billion. The Command must have 6,000 soldiers by 2016.

Alexander's successor is a US Navy officer, Vice Admiral Michael Rogers, who will take over as both head of the NSA and Cyber Command.

Hagel is set to begin next week a tour of Asia with a stop in China, where cyberspying will be a hot topic following a report in The New York Times and Germany's Der Spiegel that the NSA had secretly tapped Chinese telecoms giant Huawei for years.

The NSA had access to Huawei's email archive, communications between top company officials, and even the secret source code of some of its products, according to the reports based on information provided by fugitive former NSA contractor Edward Snowden.