Updated

Defense Secretary Leon Panetta said Thursday that the speed of the attack on the U.S. Consulate in Benghazi, Libya, last September kept U.S. armed forces from responding in time to save the four Americans who were killed.

Testifying for likely the last time on Capitol Hill before he steps down, Panetta defended the U.S. military's response on a chaotic Sept. 11 day as the Obama administration tried to assess the threat from protests in Tunisia, Egypt, the Libyan capital of Tripoli and other countries.

He insisted that there were no specific signs of an imminent attack on the diplomatic mission that killed Ambassador Chris Stevens and three other Americans. But soon after the initial attack, Panetta dispatched various military teams to Benghazi, including Marines from Spain and a special operations force that was training in Central Europe.

He pushed back against questions about why more firepower, such as gunships or fixed-wing fighter jets weren't sent. He said they were not in the vicinity and would have required at least nine to 12 hours to deploy.

"This was, pure and simple, a problem of distance and time," Panetta said.

Panetta testified before the Senate Armed Services Committee with Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff.

Dempsey reminded the committee that it was "9-11 everywhere" when the consulate was attacked and that U.S. armed forces were prepared to respond to a wide variety of threats around the world.

U.S. posts and facilities in many countries throughout Africa and southwest Asia were operating under heightened protection levels, he said.

"We positioned our forces in a way that was informed by and consistent with available threat estimates," Dempsey said.

Panetta is retiring after a Washington career that has stretched over four decades, with years as a California congressman, budget chief, White House chief of staff to President Bill Clinton and CIA director who oversaw the hunt and killing of terrorist leader Osama bin Laden.

The Defense Department is bidding farewell to Panetta, who has served as defense secretary since June 2011, in a ceremony on Friday. The committee gave Panetta a round of applause as Chairman Carl Levin, D-Mich., praised the Pentagon chief's integrity. President Barack Obama has nominated former Republican Sen. Chuck Hagel to succeed Panetta.

In his testimony, Panetta detailed the steps the military took in response to the Libya attack. He pointed out that it was not a prolonged assault that the military could have ended, but rather two short-duration attacks that occurred about six hours apart.

"Despite the uncertainty at the time, however, the Department of Defense and the rest of the United States government spared no effort to save American lives," Panetta said.