He also urged Israeli leaders to do more to restart peace talks with the Palestinians and underscored President Barack Obama's determination to stop Iran from acquiring nuclear weapons. He called Iran "a very grave threat to all of us" and said any Iranian disruption of the free flow of commerce through the Persian Gulf is a "redline" for the U.S.
In a speech at a Brookings Institution forum, Panetta said that while Israel is not solely responsible for its isolation, it could more actively attempt to reverse the trend.
"For example, Israel can reach out and mend fences with those who share an interest in regional stability — countries like Turkey and Egypt, as well as Jordan," he said. "This is not impossible. If the gestures are rebuked, the world will see those rebukes for what they are. And that is exactly why Israel should pursue them."
Panetta, who made his first visit to Israel as Pentagon chief in October, said it is in the interests of Israel as well as Turkey — which is a NATO ally of the United States — to reconcile. He said he would take that message to Ankara when he visits there in two weeks.
He urged the Israelis to address its concerns about Egypt's political revolution through increased communication and cooperation with Egyptian authorities, "not by stepping away from them."
Addressing an issue that is in the primary domain of Secretary of State Hillary Rodham Clinton, Panetta urged Israel to "lean forward" to achieve peace with the Palestinians. Peace talks have been moribund for more than a year.
"Rather than undermining the Palestinian Authority, it is in Israel's interests to strengthen it by ... continuing to transfer Palestinian tax revenues and pursuing other avenues of cooperation," he said.
Panetta spoke starkly of the challenge of Iran's nuclear ambitions.
"No greater threat exists to the security and prosperity of the Middle East than a nuclear-armed Iran," he said, adding that Obama has not ruled out using military force to stop Iran from going nuclear.
In a question-and-answer session with his audience after his speech, Panetta was asked what Israel should do to get peace talks back on track.
"Just get to the damned table," Panetta replied.
In response to questions about Iran, Panetta also laid out in detail his thinking on the arguments against an Israeli or U.S. military attack on Iran's nuclear facilities.
He said such an attack would "at best" delay Iran's nuclear program by one or two years. Among the unintended consequences, he said, would be an increase in regional support for Iran and the likelihood of Iranian retaliation against U.S. forces and bases in the Mideast. It also would have harmful economic consequences and could lead to military escalation, he said.
"We have to be careful about the unintended consequences" of an Israeli or U.S. attack, he said.