WASHINGTON — President Obama, in charting a new phase of American military engagement in Iraq, pledges that his war-weary country will not be “dragged back” into a lengthy conflict or become ensnarled in “mission creep.”

But recent U.S. military history is full of warning signs about the difficulty of keeping even a limited mission from expanding and extending. The prospect that this latest mission in Iraq could follow that pattern is particularly risky for Obama, given that he has staked so much of his legacy on having brought America’s long war there to a close.

Already some of the White House’s closest allies worry that Obama’s plan to send in 300 special operations forces to train the Iraqi military could be the first step in pulling the U.S. back into Iraq’s violent sectarian fight.

“I think that you have to be careful sending special [operations] forces because that’s a number that has a tendency to grow,” said House Democratic leader Nancy Pelosi of California, one of Obama’s staunchest supporters.

Anna Galland, the executive director of the liberal group MoveOn.org, said even a limited mission “is a dangerous and troubling development that threatens to lead to broader military engagement.”

Indeed, the U.S. has seen small operations escalate before.

The conflict in Vietnam started with Presidents Dwight Eisenhower and John F. Kennedy sending limited numbers of military advisers to train and assist local forces. But those numbers increased over time and set the stage for what ultimately became a yearslong combat operation.

The wars that began in Iraq and Afghanistan in the last decade were intended to be combat missions from the start. Few people expected at the time that the Iraq war would drag on for more than eight years, the Afghan conflict for more than a dozen years, or that the U.S. troop presence in each country would peak above 100,000.

Obama acknowledged the risks of mission creep when he outlined plans Thursday to help Iraq combat the Islamic insurgency that has made gains with lighting speed and, according to administration officials, poses a threat to U.S. interests. The Green Beret military advisers set to arrive soon in Iraq will join a previously announced contingent of 275 U.S. forces sent in the last week to secure the U.S. Embassy in Baghdad and other American interests.

The deployments mark a sharp shift for a president who oversaw the full withdrawal of American forces from Iraq in late 2011 after Washington and Baghdad failed to reach an agreement to keep a few thousand troops in place. While Obama repeatedly has cited the end of the war as one of his chief achievements, his decision to return some troops to Iraq now raises the question of whether an asterisk ultimately may accompany that claim.

Administration officials insist Obama does not intend to commit the U.S. to another lengthy war in Iraq or put American forces in combat roles. Signaling his reluctance to re-engage, Obama also decided to hold off launching airstrikes, though he left the prospect of targeted strikes on the table.

The president repeatedly made the case that expanding the U.S. military presence would do little good given that the root of Iraq’s problems is a political system that has excluded the country’s Sunni minority.

“We do not have the ability to simply solve this problem by sending in tens of thousands of troops and committing the kinds of blood and treasure that has already been expended in Iraq,” he said. “Ultimately, this is something that is going to have to be solved by the Iraqis.”

But there are few guarantees when it comes to sending Americans into Iraq’s unstable security situation. Though the troops are not being sent specifically for combat purposes, all are armed and have the right to defend themselves if they are in danger.

“As soon as you put troops or advisers in an area of conflict, they’re at risk,” said Julian Zelizer, a political history professor at Princeton University. “That is the nature of war. It’s unpredictable and it takes twist and turns that you don’t foresee.”

Iraq, with its sectarian divides, violent past and unstable politics, may be particularly susceptible to that kind of unpredictability. Obama appeared to leave himself plenty of room to quickly pull out of Iraq, outlining no timeline for how long the military advisers will stay and no vision for what would constitute a mission accomplished.

Yet it’s that loosely defined mission that leaves some of Obama’s supporters worried about the potential for another open-ended commitment to Iraq. Trying to ease their fears, Obama said he was making decisions with the “dark scars” on his mind of the eight-year war that killed nearly 4,500 American troops.

“What’s clear from the last decade is the need for the United States to ask hard questions before we take action abroad, particularly military action,” the president said.