Updated

Tucked behind Bashiqa Mountain in northern Iraq, some 500 Turkish troops stationed alongside a local militia say they are training and arming Iraqi fighters to help defeat the Islamic State group. But their presence has strained relations between Iraq and Turkey and further complicated plans to retake the militant-held city of Mosul.

Turkish heavy artillery sits along the base's outer perimeter. Past rows of blast-walls and barbed wire, dozens of trailers house some 1,000 men armed with assault rifles and outfitted with new body armor and boots.

"Everything you see here is thanks to Turkey, we didn't receive any single thing from the central government," said Iraqi Maj. Gen. Saadi Obeidi, the base's commander, sitting beside a Turkish captain to brief visiting journalists. Obeidi and the captain outlined the group's military achievements and boasted of occasionally receiving U.S.-led coalition air support.

On a scale diorama dotted with toy soldiers, the men traced the front line with IS just 5 kilometers (3 miles) to the south. Obeidi, who is no longer in Iraq's conventional military, but served as an officer in former Iraqi leader Saddam Hussein's army, blamed sectarianism for the Shiite-dominated government's refusal to arm his mostly Sunni fighters.

The controversy over the Turkish forces began late last year when a few hundred Turkish troops, tanks and heavy artillery moved into Iraq's north, sparking repeated calls from Baghdad to withdraw. Ankara has insisted that they entered Iraq with permission from Baghdad to help train anti-IS forces, citing comments from Iraq's prime minister in 2014 thanking Turkey for their support against IS as proof. Iraq's central government denies those claims.

"Initially, the central government invited us here," said the Turkish captain at Zelkan Camp, who spoke on condition of anonymity as he was not authorized to talk to the media. "Some things have changed since then, but we are already here, so we won't leave until Ankara tells us to."

Now, as Iraqi forces gear up for the long-awaited Mosul operation, Turkey says the troops, initially described as trainers, cannot be barred from having a role in retaking the city.

This week, the rhetoric between Baghdad and Ankara escalated into a personal war of words between the two countries' leaders.

"Turkey's army hasn't lost enough of its quality to take orders from you," Turkish President Recep Tayyip Erdogan said Tuesday in a speech that directly insulted Iraqi Prime Minister Haider al-Abadi.

"You are not at my level, you are not my equivalent, you are not of the same quality as me," he added. "Your screaming and shouting in Iraq is of no importance to us. You should know that we will go our own way."

Haider al-Abadi responded on Twitter later that night.

"We will liberate our land through the determination of our men and not by video calls," he said, mocking Erdogan's nationally broadcast Facetime video call to a TV journalist amid a failed coup attempt in July.

Without mentioning Turkey by name, the U.S. State Department said Wednesday that "all international forces in Iraq should be there with the approval and in coordination with the government of Iraq." The following day, Iraq summoned Turkey's ambassador, according to the foreign ministry in Baghdad.

Erdogan on Friday said Turkey is determined to take part in the battle for Mosul, despite calls from Iraq for Turkish troop withdrawal.

The fighters at Zelkan Camp are mostly police officers from the Mosul area who fled as IS swept across Iraq more than two years ago. Labeled as deserters and distrusted by Baghdad, they were originally funded by Utheel al-Nujaifi, the former governor of Ninevah province, who also fled when IS captured the city in the summer of 2014.

Parliament blamed al-Nujaifi for the humiliating retreat of Iraqi security forces, many of whom dropped their weapons and fled in the face of the IS blitz. He retreated to Iraq's largely autonomous Kurdish region, where he has spent the last two years raising funds and rallying support for his militia.

Now outfitted and armed with weapons and equipment paid for by Turkey, the fighters have dubbed themselves the National Mobilization Forces.

"The aim of these fighters will be to hold the ground after the liberation of Mosul" by Iraq's conventional military, Obeidi said.

Iraqi and coalition officials say they will need to rely on local militias and tribal forces to hold hard-fought gains in and around Mosul. But some Iraqi leaders, including commanders of powerful Shiite militias that will also take part in the Mosul operation, are wary of Turkish involvement.

"The Turkish forces are occupation forces," said Ahmed al-Asadi, a senior official in the umbrella group of mostly Shiite militia forces known as the Popular Mobilization Forces. "We will not be prevented from defending the sovereignty of Iraq," he said.

Opponents of al-Abadi have pointed to the Turkish troops to argue that he is weak and ineffective. Muqtada al-Sadr, an influential Shiite cleric who brought thousands of anti-government protesters into the streets of Baghdad earlier this year, has demanded the Turkish forces leave.

"You are on our land," he said recently. "It's better to leave (Iraq) with your honor than to be disqualified."

Turkey, meanwhile, fears that the Shiite fighters will push out Sunnis and ethnic Turkmens, altering the region's demographics and setting the stage for future conflicts.

"If you, after removing Daesh, attempt to change Mosul's demographic structure, you will light the fire of a very big civil war, of a sectarian war. This is our warning," Turkish Prime Minister Binali Yildirim said recently, using the Arabic acronym for IS.

The dispute could further delay the march on Mosul, as Iraqi and coalition leaders finalize battle plans and prepare for a potential humanitarian crisis.

Just outside Zelkan Camp, the fighters rehearsed drills, walking into a nearby village in two columns and slowly clearing houses. The Turkish captain said that while the fighters were practicing offensive techniques, they have no plans to participate in the assault on Mosul.

"But if we are asked to go, we will go," he said. "We only take our orders from Ankara."

___

Abdul-Zahra reported from Baghdad. Associated Press writers Salar Salim and Balint Szlanko in Zelkan Camp, Iraq, and Suzan Fraser in Ankara, Turkey, contributed to this report.