Updated

The former top U.S. commander in northern Iraq defended the multibillion dollar American effort to train Iraqi security forces despite this week's Sunni insurgent offensive that has seen key cities occupied as soldiers and police abandoned their posts.

Mark Hertling, a retired general who led American forces in the volatile region in 2007-2008 as they fought to end sectarian warfare that pushed the country to the brink of civil war, said neglect by the Shiite-led government left Iraq in a precarious position and "squandered" the opportunity for real progress.

"There is a continued use of the military as an element of power, as opposed to a security mechanism," he told The Associated Press in a telephone interview Thursday. "There has been more of a focus on consolidating power by the current administration, versus taking care of people and ensuring their security."

In a stunning advance, an al-Qaida splinter group has led gunmen in capturing two key Sunni-dominated cities in northern Iraq and pushing deep into parts of the Iraqi Sunni heartland once controlled by U.S. troops, as soldiers and police abandoned their posts by the dozens. Northern Iraq was one of the hardest areas to control during the years after the 2003 U.S.-led invasion that ousted Saddam Hussein and his Sunni-dominated regime, propelling majority Shiites to power.

Hertling said it was frustrating to watch the developments from afar and to listen to criticism of the U.S. military's costly effort to prepare Iraqi forces to take over their own security before the Americans withdrew at the end of 2011. Nearly 4,500 U.S. troops and tens of thousands of Iraqis were killed in the fighting. There were a few years of relative peace, but violence has spiked again in recent months.

"It's extremely hard for me to watch, especially given that we had a lot of young soldiers making the ultimate sacrifice, a lot of soldiers wounded and a lot of soldiers who just served their time," he said.

He said Prime Minister Nouri al-Maliki's government had failed to solidify gains made by the Americans and focused instead on installing Shiites into leadership positions and replacing good military commanders with those it considered allies. Al-Maliki asked parliament this week to declare a state of emergency that would give him increased powers to run the country, but on Thursday the lawmakers failed to assemble a quorum to do so.

The Iraqi military forces "have not been treated well," Hertling said. "While we were there, we were helping them train. We were protecting them."

"Holy smokes, I mean we were training them and operating with them ... and here it is three years later, and it's a different military than we trained."

"There's been a lot of change of leadership," he said. "So I'm not prepared to take all the blame for them taking off their uniforms and giving away their arms."

He also blamed the civil war in neighboring Syria for emboldening the Sunni insurgents and sending many fighters across the border on both sides. He said the recent increase in bloodshed in Iraq could have been prevented.

"The central government could have been more inclusive with all sects. ... They could have worked harder on solving the problems of Iraq," he said. "It's saddening and it's disheartening and you know you can't do anything about it, to fix it. The opportunity was there and I think it's been squandered."