BAGHDAD — Defense Secretary Leon Panetta on Monday appeared to justify the U.S. invasion of Iraq as part of the war against al-Qaeda, an argument controversially made by the Bush administration but refuted by President Obama and many Democrats.

Panetta made his remarks during his his inaugural visit to Iraq as Pentagon chief. Speaking to about 100 soldiers at Camp Victory, the largest U.S. military installation in Baghdad, he said his primary goal as defense secretary was to defeat al-Qaeda worldwide.

“The reason you guys are here is because on 9/11 the United States got attacked,” Panetta told the troops. “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.”