Panetta said a strike on Iran could harm the world economy. He also pointed to a U.S. analysis that a strike on Iran would set back its nuclear program, which Iran says is only for peaceful purposes, by one or two years at most.
Panetta was due to attend a security forum in Halifax, Canada, where he was also expected to hold bilateral talks with Israeli Defense Minister Ehud Barak.
Tension over Iran's nuclear program has increased since an International Atomic Energy Agency (IAEA) report said that Tehran appeared to have worked on designing a bomb and may still be conducting secret research to that end.
Iran has warned that it will respond to any attacks by hitting Israel and U.S. interests in the Persian Gulf.
Analysts say Tehran could retaliate by closing the Strait of Hormuz, the waterway where about 40 percent of all traded oil passes.
compiled from agency reports