BAGHDAD — After billions of dollars and nearly nine years of training, U.S. troops are leaving behind an Iraqi security force arguably capable of providing internal security but unprepared to defend the nation against foreign threats at a time of rising tensions throughout the Middle East.
Building up an Iraqi military and police able to protect the country became a key goal of the United States and its allies after they defeated and then disbanded the Saddam Hussein-era force in 2003.
As America's role in Iraq fades, the results appear at best incomplete.
Iraqi forces - currently about 700,000 strong - have been largely responsible for security in Baghdad and other cities since 2009, carrying out their own raids and other combat operations against insurgents.
More than 10,000 Iraqi soldiers and police have been killed since the new force was established - more than double the number of U.S. military deaths.
Few if any military forces in the Arab world have as much combat experience within the ranks.
"They can kick a door in and knock out a network's leadership as good as anybody I've seen," said Lt. Gen. Robert Caslen, commander of the NATO training mission, which soon will be disbanded. "I would say that they have the discipline and the tenacity to fight as well as anybody I've ever seen."
Nevertheless, Iraqi forces have their work cut out for them. They will be operating in a country that, although quieter than a few years ago, saw more people killed, wounded and kidnapped last year than in Afghanistan, according to U.S. figures.
The departure of American forces this month also leaves Iraq vulnerable to threats from its neighbors - Iran to the east, Turkey to the north and Syria to the west.
A major Arab country of about 30 million people with some of the world's largest proven petroleum reserves, Iraq is incapable of defending its borders in one of the most unstable parts of the world.
The Iraqi military chief of staff, Lt. Gen. Babaker Zebari, has said it will take until at least 2020 for Iraq to defend its airspace.
Without a well-trained and well-equipped air force, Iraqi ground forces would be hard-pressed to defend against incursions across borders with few natural barriers and little cover from vegetation.
"An army without an air force is exposed," Gen. Zebari was quoted as saying in a report last October by the U.S. agency responsible for overseeing Iraqi reconstruction.
Even though a full-scale ground invasion from its neighbors may seem remote, the possibility of incursions from Turkey against Kurdish rebels, or Iranians along disputed border stretches or even from a Syria facing an internal revolt cannot be ruled out.
External defense seemed a low priority in the early years of the Iraq war, when tens of thousands of U.S. troops, tanks, planes and artillery served as a deterrent.
But there wasn't enough time to develop the full package - logistics, intelligence, medical services and a fully integrated command structure - for the Iraqis to operate effectively without U.S. support.
A budget crisis in 2009 and a lengthy political stalemate the following year "crippled both the qualitative development of Iraq's forces and its ability to implement its own development plan," wrote analyst Anthony Cordesman of the Center for Strategic and International Studies.