WASHINGTON — Defense Secretary Leon Panetta’s pointed warning that the U.S. will strike back against a cyberattack underscores the Obama administration’s growing concern that Iran could be the first country to unleash cyberterrorism on America.

Panetta’s unusually strong comments Thursday came as former U.S. government officials and cybersecurity experts said the U.S. believes Iranian-based hackers were responsible for cyberattacks that devastated computer systems of Persian Gulf oil and gas companies.

Unencumbered by diplomatic or economic ties that restrain other nations from direct conflict with the U.S., Iran is an unpredictable foe that national security experts contend is capable and willing to use a sophisticated computer-based attack.

Panetta made it clear that the military is ready to retaliate, though he didn’t say how, if it believes the nation is threatened by a cyberattack, and he made it evident that the U.S. would consider a pre-emptive strike.

“Iran is a country for whom terror has simply been another tool in their foreign policy toolbox, and they are a country that feels it has less and less to lose by breaking the norms of the rest of the world,” said Stewart Baker, former assistant secretary at the Department of Homeland Security and now in private law practice.

“If anybody is going to release irresponsible unlimited attacks, you’d expect it to be Iran.”

National security experts have long complained that the administration needs to be more open about what the military could and would do if the U.S. were to be the victim of cyberattacks. They argue that such deterrence worked in the Cold War with Russia and would help convince would-be attackers that an assault on America would have dire results.

Panetta took the first steps toward answering those critics in a speech analysts said was a thinly veiled warning to Iran, and the opening salvo in the campaign to convince Tehran that any cyberattack against America would trigger a swift and deadly response.

“Potential aggressors should be aware that the United States has the capacity to locate them and hold them accountable for actions that harm America or its interests,” Panetta said in a speech in New York City to the Business Executives for National Security.

And while he did not directly connect Iran to the Gulf cyberattacks, he warned that Iran’s abilities were growing.