BAGHDAD, Iraq (CNN) -- Iraq is still the center of the U.S. battle against terrorism even as American troops shift their focus toward the nearly eight-year-old war in Afghanistan, the U.S. commander in the region said Friday.
Gen. David Petraeus says Iraq remains "very important strategically."
U.S. troops have withdrawn from Iraq's cities, and their combat role is greatly reduced. But "innumerable challenges" remain there, and al Qaeda operatives there are connected to others in Afghanistan and other countries, Gen. David Petraeus said.
"You have AQ [al Qaeda] connections across the senior leadership in the federally administered tribal areas in western Pakistan, extending into Afghanistan and threatening Pakistan, and then, very much, threatening the rest of the world," said Petraeus, the chief of U.S. Central Command. "Links form there to al Qaeda in the Arabian peninsula, which is re-establishing itself in south Yemen -- just beginning, but it is there."
In addition, Iraq remains "very important strategically" because of its central location in the Middle East and its oil and gas reserves, estimated at the world's third-largest.
Petraeus was in Baghdad for meetings with Gen. Raymond Odierno, the top U.S. commander in Iraq, and other military and political officials. His agenda includes an assessment of security since the June 30 withdrawal of American combat troops from Iraq's urban areas.
He said an initial report shows the transition is going well. But violence remains a concern, he said, and the continued presence of al Qaeda in Iraq and Iranian-backed militias poses an ongoing threat to the Iraqi government.
Petraeus arrived in Baghdad a day before a major political event in Iraq -- local elections in Iraq's semi-autonomous Kurdistan region. There has been tension between the central government and Kurdish officials over the allocation of energy resources and the handling of territorial disputes, and Petraeus also said that he is concerned that "political competition will turn from shouting to shooting."
Petraeus served nearly four years in Iraq and was one of the main advocates of the "surge" that saw another 30,000 American troops deployed in an effort to quell the sectarian warfare that ravaged the country in 2006 and 2007. The commitment was combined with U.S. support for Iraqi tribal leaders who turned against the jihadists, and Petraeus said some of those lessons can be put to use in Afghanistan.
"Some are very obvious -- you shouldn't start clearing until you can start to hold and build," he said, referring to the steps of U.S. counterinsurgency strategy. "It wasn't just the surge, the 30,000 troops. It was the employment of those forces, living with the people. You cannot kill or capture your way out of this endeavor."
Afghanistan was the original front in the battle against al Qaeda, the terrorist network behind the September 11, 2001, attacks on New York and Washington. The roughly 60,000 U.S. troops now in the country are battling a resurgence of the Taliban, the fundamentalist Islamic militia that allowed al Qaeda to operate from its territory before the attacks.
U.S. officials are now hoping to drive a wedge between Taliban leaders and ordinary Afghans, Petraeus said, though the effort has not been employed as extensively as it was in Iraq.
"There has always been activity at local levels that one would characterize as reaching out to elements who want to be a part of the solution rather than the problem," he said.
CNN's Arwa Damon and Yousif Bassil contributed to this report.