Just 11 days into his tenure as defense secretary, Leon Panetta has demonstrated a flair for making blunt, unscripted comments. But his inability to stick to prepared talking points is getting him into rhetorical trouble.

On Monday, in his first visit to Iraq as Pentagon chief, Panetta appeared to justify the U.S. invasion of the country as part of the war against al-Qaeda, a controversial argument made by the George W. Bush administration but rebutted by President Obama and many Democrats.

Two days earlier, in Kabul, Panetta told reporters — repeatedly — that the United States would keep 70,000 troops in Afghanistan until the end of 2014. That would have come as unwelcome news to the White House, which has pledged to bring far more service members home by then, and his aides scurried afterward to say he misspoke.

In hiring Panetta, 73, to run the Pentagon, Obama portrayed him as an experienced Washington hand: a White House chief of staff in the Clinton administration, a nine-term congressman and director of the CIA from 2009 until last month.

Although Panetta won bipartisan plaudits for his leadership of the spy agency, especially the handling of the raid that killed al-Qaeda leader Osama bin Laden, he was accustomed to working in the shadows. As intelligence chief, he rarely needed to appear in public, except to testify before Congress or give the occasional interview.

As defense secretary, however, his movements and words are closely tracked by the Pentagon press corps, which has accompanied him on a multi-day tour of the war zones in Iraq and Afghanistan. In contrast to his poker-faced predecessor, Robert M. Gates, it turns out that Panetta happily speaks off the cuff and doesn’t seem to edit his thoughts too closely.

In an interview Monday with NBC News, Panetta gave a lighthearted explanation for his straightforward manner. “I’m Italian, what the frick can I tell you,” he said.

During a 30-minute question-and-answer session with U.S. troops in Baghdad on Monday, Panetta used plenty of salty language. Nothing X-rated, to be sure, but no diplomatic politesse, either.

He noted that the region had “had a hell of a lot of turmoil” in recent years. And he said there was a downside to Iraq’s transition to a democratic system, pointing out that the coalition government has dragged its feet for months in making key cabinet appointments.

“Do they want to have a minister of defense, or don’t they want to have a minister of defense?” he wondered aloud. “But dammit, make a decision.”

Asked by a soldier when NATO allies were going to start pulling their weight, Panetta didn’t hold back. “I’m a believer in partnerships, but when you talk about partnerships, dammit, you’ve got to be partners,” he said.

He made the observation that Iraq is rich in oil. “This damn country has a hell of a lot of resources,” he noted.

Panetta, a jovial Californian, has also shown that he’s not afraid to make a point by resorting to a risky combination of humor and religion.

During a tour of Afghanistan’s Helmand province Sunday, he told a group of Marines and sailors a joke about a rabbi and a priest who went to a boxing match. One of the fighters kept making the sign of the cross, and the rabbi asked the priest why — and whether it did any good.

“It doesn’t mean a damn thing unless you can fight,” the priest replied. The same goes for the military, Panetta said.

The joke got a round of appreciative laughs, but his comments Monday about al-Qaeda and the Iraq war raised eyebrows.

“The reason you guys are here is because on 9/11 the United States got attacked,” he told troops at Camp Victory, the largest U.S. military outpost in Baghdad. “And 3,000 Americans — 3,000 not just Americans, 3,000 human beings, innocent human beings — got killed because of al-Qaeda. And we’ve been fighting as a result of that.”

His statement echoed comments made by Bush and his administration, which tried to tie then-Iraqi leader Saddam Hussein to al-Qaeda. But it put Panetta at odds with Obama, the 9/11 Commission and other independent experts, who have said that al-Qaeda lacked a presence in Iraq before the U.S.-led invasion in 2003.

Pressed by reporters to elaborate, Panetta said: “I wasn’t saying, you know, the invasion — or going into the issues or the justification of that. It was more the fact that we really had to deal with al-Qaeda here; they developed a presence here and that tied in.” His aides then intervened and shooed the press corps away.

Douglas Wilson, a spokesman for Panetta, said the defense secretary wasn’t trying to reopen the contentious debate about the rationale for the Iraq war.

“I don’t think he’s going down that rabbit hole,” Wilson said. “I don’t think he’s getting into the arguments of 2002 and 2003. He’s dealing with the security situation our country faces today.”

Defense officials portrayed Panetta’s candor as an asset. “This is a plainspoken secretary of defense,” Wilson said, adding that the Pentagon chief adopts the same tone in meetings with foreign leaders, to good effect.