Jim Michaels

USA TODAY

WASHINGTON — Left unsaid in President Obama’s announcement Wednesday that he will keep more troops in Afghanistan: fear of repeating the cycle of violence that continues to grip Iraq five years after U.S. forces withdrew.

In 2011, the last American troops left Iraq after negotiations with the Iraqi government broke down over legal protections for maintaining a U.S. military presence.

Obama: 8,400 troops to remain in Afghanistan

Less than three years later, the Islamic State swept into Iraq from its strongholds in Syria, encountering little resistance from U.S.-trained Iraqi security forces who abandoned their equipment and fled.

Today, the United States and its allies are still dealing with the mess. U.S. advisers are attempting to rebuild Iraq’s military, and coalition airstrikes are hammering Islamic State fighters and equipment.

The Islamic State is slowly getting pushed out of the country, and Iraq’s military is getting stronger, but not before Americans had to return to Iraq.

Afghanistan is not Iraq, but it is also fighting an insurgency without an end in sight.

Obama said the United States will leave 8,400 troops in Afghanistan through the end of his term, instead of dropping the number to 5,500 as he previously planned.

As in Iraq, the U.S. mission in Afghanistan is to train and support the country’s security forces. American troops are no longer engaged in direct combat. But Afghan forces are far from being capable of operating without external help.

Afghan security forces hold all major cities in the country, but the Taliban— the militant group that ruled the country until ousted by U.S. forces in 2001 — has made inroads in remote parts of Afghanistan.

The Taliban isn’t the only worry. The Pentagon views the Islamic State in Afghanistan as an “emergent” threat, even though the extremist group doesn’t have a large presence.

Afghan forces still badly need help with firepower and air support, which they relied on when Americans were engaged in combat operations from 2001 to 2014.

The Pentagon recently widened the authority of U.S. advisers to help Afghan forces with airstrikes when they conduct offensive operations, which will them a major boost.

U.S. launches first attacks on Taliban under new rules

The continued presence of U.S. and allied advisers help in more subtle ways, sometimes stiffening the resolve of Afghan forces in the event of a major insurgent threat. In the northern Afghan city of Kunduz, U.S. special forces advisers and warplanes recently helped expel a Taliban takeover.

Iraq's U.S.-trained military force weakened rapidly after American troops left. Then-Prime Minister Nouri al-Maliki replaced many officers with political cronies, and training all but stopped. Moreover, the Shiite-dominated military alienated Iraq's minority Sunni population — many of whom supported the Islamic State, composed of fellow Sunnis.

It’s not certain a continued U.S. presence would have made a difference in Iraq, but the White House doesn’t want take that chance in Afghanistan.