Baghdad - The US security personnel sent to help Iraqi forces combat the Islamic State of Iraq and the Levant (ISIL) will be on the front lines alongside Iraqi troops and Kurdish forces, but will not engage in fighting unless for self-defence, Iraqi officials said.

Iraq is facing its worst security crisis since US troops left the country in December 2011, as ISIL fighters have seized large tracts of territory in the country's north and west. US President Barack Obama approved sending up to 3,100 American security personnel back to Iraq to work closely with Iraqi troops against ISIL.

"Those advisers will be deployed in five fortified military bases, which are scattered in the areas that witness military operations across the country, including the Kurdistan region," Saad al-Hadithi, a spokesperson for Iraqi Prime Minister Haider al-Abbadi, told Al Jazeera.

"Their tasks will be limited to training and rehabilitating the Iraqi troops with respect to the US weapons [that the Iraqi government has] ... and to suggest appropriate plans," Hadithi said. "There will be no fighting missions."

RELATED: 'Iraq is now like a drowning man'

A federal Iraqi security adviser who works closely with the US advisers, and who spoke to Al Jazeera on condition of anonymity, confirmed the advisers would not take part in any combat operations, except in self-defence.

"Just 600 of the 3,100 security personnel are either advisers, experts or technicians and the rest are members of the protection and logistical support team," the federal adviser said.

A total of 1,500 US military personal have arrived in Iraq since June, deployed in two operations centres in Baghdad and Erbil to coordinate with local troops and identify ISIL air targets for the US-led campaign of air strikes.

Earlier this month, the Obama administration announced it would widen its advisory mission and initiate training of Iraqi forces.

Since then, US military personnel have started showing up at the Iraqi defence ministry in Baghdad on a daily basis, several Iraqi officers told Al Jazeera.

Iraqi officials said the US experts, trainers and advisers were being distributed in groups: 50 personnel at the Nuamaniya military base in southeastern Baghdad, 109 at the Habaniya air base in western Baghdad, 200 at the Ain al-Asad military base in western Baghdad, 100 to 125 at the Spyicher military base in northern Baghdad and 300 in Erbil. Additional US troops may be sent to the Balad and Dabas bases if the bases can be secured, officials said.

Backed by Shia militias and volunteers, Iraqi security forces have recently achieved several significant victories in southern and northern Baghdad.

Last month, Iraqi troops gained control over the strategic towns of Jurf al-Sakhar in southern Baghdad and Baiji in northern Baghdad, which were seized by ISIL fighters and comprise key supply routes for troops in the south and north.

On November 17, further progress was made when Iraqi troops broke ISIL's months-long siege on Iraq's largest oil refinery, located north of Baiji. Iraq's prime minister and military officers said Shia militias and volunteers, including anti-ISIL Sunni tribespeople, provided crucial assistance.

But Iraqi security officials, including the federal adviser, told Al Jazeera that US security advisers refused to attend any joint meetings with commanders of the Shia militias, volunteers or the Iranian advisers working in the battlefields with Iraqi and Kurdish troops. The US advisers also stipulated that their decisions with respect to military deployment, plans and selected targets were binding on Iraqi forces.

"They want to be immune against the penetrations of ISIL, Iran and the Iraqi armed factions," the federal adviser said.

Most of the Iraqi Shia militias with strong links to Iran - including the Badr Organisation, Asaib Ahl al-Huq, Kataib Huzballa-Iraq and Saraya al-Salam (the new name of the Mahdi Army which belongs to Muqtada al-Sadr, a leading Iraqi Shia figure) - have all publicly threatened to withdraw their fighters from the front lines against ISIL, saying they would regard US military personnel anywhere in Iraq as enemy forces.

"Our formal stand states that all the Saraya al-Salam troops have to step down and leave the area wherever there will be US military forces," Abu Shams al-Uqaili, spokesperson for Saraya al-Salam militia, told Al Jazeera.

Abbadi has previously warned of ISIL's attempts to target US trainers and advisers. In a televised speech, the prime minister said: "Daesh [ISIL] will try to violate the Shia groups by using money [to buy them] and other tools to hit the [US] advisers and trainers who are under the protection of the Iraqi government. Any attack on them will not be allowed."

The Iraqi federal adviser who spoke on condition of anonymity said targeting of US security personnel in the country was likely, but Iraqi authorities have consequently tightened security measures.

The Iraqi government would establish security operations centres with access only to Iraqi army officers and the US advisers. A separate operation centre will include Iraqi army officers, Iranian advisers, Shia militia commanders, the anti-ISIL Sunni tribesmen and other informal armed groups.

"Initially, they [US security personnel] will be in military camps located away from the 'public crowd' [Shia militias and volunteers] ... and the commanders of the public crowd will be kept away from the joint military operations centres," the adviser said.