The attack was the most humiliating the Iraqi military had faced since June, when security forces melted away in the face of the Islamic State group's lightning advance across northern Iraq.

Disguised in Iraqi army uniforms, and bearing heavy arms behind the wheels of stolen Humvees, militants stormed Camp Saqlawiyah in Iraq's western Anbar province, prompting as many as 700 to flee for their lives. At least 40 soldiers died in the Sept. 21 onslaught. Another 68 were taken prisoner, and later, piled into a military truck and paraded through the streets of Fallujah.

The military was vulnerable, ill-prepared and poorly equipped to withstand the ambush. Soldiers who fled the front line said that they hadn't been trained for such heavy fighting, were given no orders, and had been living mainly on a diet of salty water and canned tomatoes.

The defeat shows the extent of the task as, for the first time, the Obama administration moves to deploy military advisers directly on the ground in Anbar and other battle zones. It's part of a planned expansion in training and advising of the Iraqi military — a risky step for the U.S, which until now has been wary about front-line involvement and fearful of history repeating itself.

"No mission that we undertake anywhere in the world is risk-free," Pentagon Spokesman Rear Adm. John Kirby said Friday. "These trainers will be operating at fixed sites that we are surveying right now."

U.S. President Barack Obama has asked Congress for $5.6 billion for the expansion. He said Friday he has authorized the deployment of up to 1,500 more American troops to bolster Iraqi forces, which could more than double the total number of U.S. forces to 3,100. He said this represents a new phase in the campaign against IS as the U.S. plays a bigger role in enabling the Iraqis to go on the offensive.

In Anbar, territory is increasingly slipping out of the Iraqi government's hands — most recently large parts of the provincial capital, Ramadi, where the militants have gradually chipped away at the military's resistance.

An American advisory mission visited Anbar this week for site surveys at al-Asad air base, formerly the largest coalition base in western Iraq, as they search for potential locations for training missions to commence.

The U.S. has already sent assessment teams to an Iraqi military base in Taji, 20 kilometers (12 miles) north of Baghdad, for discussions with Iraqi colleagues on the best ways to collaborate. The U.S. is looking to train Iraqi security forces on issues ranging from weaponry, synchronization, fire-maneuvering and gunnery, as well as ways to better integrate the efforts of ground forces with coalition airstrikes.

Obama has said restoring Iraq's borders is his first priority, ahead of trying to roll back IS in Syria. But if Iraqi forces are unable to push back IS and recover lost territory, Obama would be faced with a choice of accepting failure in Iraq or committing U.S. combat troops — which would break his pledge not to get involved in fighting another Iraq war.

Anbar resonates with many Americans because they recall how costly the fighting was there for U.S. troops. A lasting image of the war was the bodies of U.S. contractors hanging from a Euphrates River bridge in Fallujah in March 2004. And the November 2004 fight to retake Fallujah was an iconic moment for the Marines.

More than 3,500 U.S. soldiers died in combat in Iraq between 2003 and 2011 — and there are concerns that sending Americans back to Anbar in any capacity will inevitably make them a target.

The return of U.S. forces in greater numbers also raises the old question of granting American troops immunity from Iraqi law. Under the government of former Prime Minister Nouri al-Maliki, immunity was a major sticking point between Washington and Baghdad which ultimately led to the decision to withdraw all remaining U.S. troops by Dec. 2011. With American forces now returning, albeit in much smaller numbers, Iraq's new Prime Minister Haider al-Abadi will inevitably face these questions.

The militant Islamist group has overrun a large part of Anbar province in its push to expand its territory, which now stands at about a third of both Iraq and Syria. This month, more than 200 men, women and children from the Sunni Al Bu Nimr tribe in Anbar were killed by the militant group, which apparently feared the tribe would challenge its authority in the province.

Until now, 12 U.S. advisory teams had been operating in Iraq since August — seven in a joint operations center in Baghdad, and the remainder at a similar facility in Irbil, the capital of the semi-autonomous Kurdish region.

But advisers alone may not be the answer. The U.S.-trained Iraqi military has been gutted since the crisis began.

After months of small-scale attacks around Iraq's second-largest city, Mosul, it buckled almost instantly in June when militants advanced on the city. Commanders disappeared. Pleas for more ammunition went unanswered. In some cases, soldiers stripped off their uniforms and ran.

Iraqi officials say the country's total military and police force stands at one million men. However, a senior U.S. military official told The Associated Press that as of June, the Iraqi military strength stood, generously, at 125,000 men, down from 205,000 in Jan. 2014, forcing it to rely heavily on unruly Shiite militias for reinforcement. The official spoke anonymously as he is not authorized to brief the media.

Part of the plan to boost Iraqi forces includes training, equipping and paying Sunni tribesmen to join in the fight against the Islamic State group, reminiscent of the Sunni Sahwa, or Awakening movement which confronted al-Qaeda in Iraq starting in 2006. On Tuesday, a low-key ceremony led by Parliament Speaker Salim al-Jabouri was held at al-Asad air base in Anbar to inaugurate the first group of Sunni fighters in what Iraqi and American officials hope is the makings of a full-fledged non-sectarian national guard. However, this has been a challenging process since many of the Sunni tribes involved in the Sahwa campaign felt a breach of trust after the American and Iraqi governments' commitment to the program waned.

Even as an expanding coalition joins the aerial campaign targeting the militant group, Iraqi forces are struggling to maintain a grip on this historically problematic province. This leaves the U.S. and its allies in a difficult position as it increasingly commits to tackling this growing threat.

"The issue is whether there is political will in the White House to accept the types of plans that are being recommended," said Richard Brennan, an Iraq expert at RAND Corporation and a former Department of Defense policymaker. There is "pressure to keep numbers small, which is going to undermine recommendations of commanders on the ground."

--------------------------------------

AP National Security Writer Robert Burns and Lolita C. Baldor contributed to this report from Washington.