President Obama has committed almost 1,000 U.S. troops back into Iraq. It is a huge move for a president whose opposition to the war in that nation was a key element in his political rise.
It also brings a whole host of complicated problems in its wake.
Avoid another Benghazi
The top priority in Iraq is to protect American civilians, troops and facilities.
The United States has an embassy in Baghdad, a presence at a nearby airfield and consulates in Erbil and Basrah. There are also thousands of State Department personnel and contractors serving in Iraq.
The U.S. airstrikes that were recently authorized by the White House were expressly intended to protect U.S. facilities and personnel, and help lift the Islamic State in Iraq and Syria's (ISIS) siege of Mount Sinjar, where Iraqi refugees had fled without food or water. In northern Iraq, those airstrikes killed ISIS fighters who had been advancing on Erbil. The U.S. has successfully disrupted the group's progress there, but military leaders caution that American gains are only temporary.
The U.S. has also deployed 900 U.S. troops to Baghdad to secure Americans who are already present there, fly more than 60 surveillance flights over Iraq daily and stand up two joint operations centers in Baghdad and Erbil.
The United States is also arming Kurdish forces in the north, hoping that they can stop ISIS's march towards Erbil, rather than relying on the Americans to do so.
The Obama administration wants "to avoid another Benghazi moment," said Brian Katulis, senior fellow at the Center for American Progress.
There are continuing dangers, however, in the shape of ISIS's numerical strength, military prowess and capacity to mount lightning-advances across Iraq.
Getting Iraq to form a new, inclusive government
The second most vital priority in Iraq is to pressure the Iraqi government to put together a new government that will address the political issues that helped lead to ISIS's advance in the first place.
ISIS capitalized on grievances of Sunnis who felt that the Shiite-led government of Prime Minister Nouri al-Maliki had become too sectarian.
The Obama administration appears to have succeeded in persuading Maliki to step down and make way for the new appointee, Haider al-Abadi.
Once the government is formed, the United States plans to help reform Iraq's security institutions.
U.S. policymakers are leaning toward helping Iraq create a strong national force augmented by regional local forces who will secure their own areas. In theory, at least, this would ease sectarian conflict between Iraq's different political and religious populations.
The main challenge will be whether Iraqi politicians can form this new, inclusive government before ISIS can sow further sectarian violence, or score any further tactical gains on the battlefield.
"It was a major step to get Maliki to step down, but it doesn't solve the problem of sectarian [divisions]," Katulis said.
Prevent more humanitarian crises
The international community called for action when tens of thousands who are part of an Iraqi minority sect, known as the Yazidis, became stranded atop Mount Sinjar in northeastern Iraq, after fleeing a massacre by ISIS.
The president authorized airstrikes against ISIS fighters as well as airdrops of food and other aid to the Yazidis.
However, there are other Iraqi minorities, such as Iraqi Christians in northern Iraq, who are also fleeing ISIS. U.S. lawmakers have increased calls for the Obama administration to help these people, and the White House has left open whether or not it will do so.
The challenge for the administration is whether it can draw a line on what humanitarian missions it will conduct and when. There is also the ever-present fear of something going badly wrong.
The salutary precedent here is the humanitarian mission in Somalia that ended in a huge fiasco in 1993. Then, U.S. special operations forces tried to kidnap a Somali warlord. Eighteen American troops were killed and 80 wounded in a disastrous operation known as "Blackhawk Down."
Protect the homeland and degrade ISIS
The U.S.'s long-term goal is to protect the homeland and to degrade ISIS.
Although ISIS is considered by experts to be first and foremost a regional security threat, thousands of foreign fighters have flocked to Iraq and Syria to fight, including many with Western passports.
These trained fighters could return to their homes in the United States and Europe, where they could attempt to launch attacks.
Meanwhile, the United States is looking to not only degrade ISIS's influence and presence in Iraq but also in Syria, where the Islamic militants have established a safe haven.
"These problems in Iraq and Syria are interlinked," said Katulis. "ISIS might just scurry across the border to Syria."
The White House in June announced a $5 billion counterterrorism partnerships fund that would devote millions to training and equipping moderate Syrian rebels against ISIS in Syria.
But big questions remain as to the lengths the Obama administration would be willing to go into this area. It is well aware that the American public is weary of interventions, especially in the Middle East.
No 'combat boots on the ground'
The administration is determined not to find itself committing U.S. forces to combat in Iraq, and officials have emphasized this point repeatedly.
Although the nearly-1,000 U.S. troops in Iraq — including the approximately 100 forces at the U.S. Embassy in Baghdad — do not have combat missions, all are armed and can act in self-defense.
The key question: Can U.S. forces be present in Iraq without being dragged into combat, purposely or accidentally?
"The country is not in a good mood to support any kind of action overseas," said Katulis.