WASHINGTON — The United States and Iraq have reached an agreement on legal protections for 300 military advisers who will soon begin work to help struggling Iraqi forces find their footing in the face of an insurgent tide.

The protections are based on an exchange of diplomatic note between the two nations, and provide legal protections equivalent to the diplomatic immunity enjoyed by U.S. troops already advising on non-operational matters like foreign military sales.

“We believe these protections are adequate to the short-term assessment and advisory mission our troops will be performing in Iraq,” Pentagon press secretary Rear Adm. John Kirby said in a statement Monday. “With this agreement, we will be able to start establishing the first few assessment teams.”

A complete pullout of U.S. troops in 2011 was spurred by the failure to negotiate a status of forces agreement that provided immunity from the Iraqi justice system to U.S. troops. White House press secretary Josh Earnest on Monday told reporters the latest negotiation over legal immunity was a far different matter.

For one thing, the number of troops in question is far smaller. Iraq’s attitude in the face of an onslaught by the Islamic State in Iraq and the Levant, or ISIL, has changed as well, he said.

“It’s a little bit different now where you have the Maliki government coming to the Obama administration and saying that they would like to see American troops there,” Earnest said.

Officials say teams of advisers will begin their work soon, and that some of the troops, who officials have said are Army Special Forces, are already in the country in other capacities.

“Probably two or three of these 12-man teams will come from personnel that are already in Iraq,” Pentagon spokesman Col. Steve Warren said. “And the remainder will come from outside of Iraq but within the CENTCOM area of operations.”

The advisers will provide information on the capacity and needs of the Iraqi military as it attempts to stand up to ISIL. Advisory teams will also help set up joint operational centers in Baghdad and northern Iraq to help the Iraq military counter Islamist militants, who have overrun numerous cities in recent weeks. The advisers are expected to train and provide intelligence to Iraqi troops, but will not engage in combat alongside them, Obama promised.

carroll.chris@stripes.com

Twitter: @ChrisCarroll_

