Vital US infrastructure including power grids and banking systems have been put under simulated attack in a week-long security exercise called Cyber Storm.
Cyber Storm took place on computers isolated from the net
The war game drew in 115 agencies from the FBI and CIA to the Red Cross, the Department of Homeland Security said.
IT companies and state and foreign governments also played a role in responding to the mock attacks.
The exercise had given the US "an excellent opportunity to enhance our nation's cyber security," the US said.
"Cyber security is critical to protecting our nation's infrastructure," George Foresman of the Department of Homeland Security added in a statement.
The US has been accused of being unprepared for a determined attack by hackers.
Cyber Storm reportedly not only tested against attacks by hackers, but also by bloggers - who deliberately spread misinformation in the exercise.
It was carried out on secure computers in the basement of the Secret Service in Washington DC.
There was no effect on the internet.
The exercise was the latest in a series of simulated attacks, including a gas attack on the New York subway.