Islamic State (IS) militants attacked a training camp in northern Iraq for fighters battling the extremist group, killing at least two Iraqi Sunni fighters and wounding four Turkish trainers, officials said December 16.

The camp in the Bashiqa region near the IS-held city of Mosul came under mortar fire for hours and was hit by Katyusha rockets fired by IS militants during a battle with Iraq's Kurdish Peshmerga fighters.

Turkey's military said Turkish artillery units fired back at IS targets.

More than 1,000 fighters were receiving training at the camp when it came under attack.

The attack came amid a dispute between Turkey and Iraq over Ankara's recent move to send reinforcements for its trainers at the camp.

Baghdad has insisted the Turkish troops were not invited and must leave, but Turkey insists that reinforcements were needed because the troops were in danger of coming under fire from IS strongholds nearby.

Iraqi Kurdish officials said the IS shelling in the Bashiqa area was part of a multipronged attack attempting to break through lines held by Peshmerga forces in several separate areas around Mosul.

IS used mortars, rockets, and car bombs ahead of ground attacks during the assault, which was ultimately foiled, Kurdish officials said.

The Peshmerga forces killed over 70 IS fighters "in a major coordinated attack across several fronts" that also included 25 air strikes by U.S.-led coalition warplanes, the officials said.

Kurdish forces last month retook the nearby town of Sinjar from IS, cutting the main road between Mosul and Raqqa, the capital of IS's self-proclaimed caliphate.

The IS attack came days after Turkey, under intense pressure from Baghdad, was forced to pull out some of its reinforcements, which it moved to another base inside Iraq's Kurdish autonomous region.

Turkey had stationed forces at Bashiqa since last year to help train the Kurdish and Sunni forces. But the arrival of the additional troops earlier this month sparked an uproar in Baghdad, which said they were unauthorized and demanded their immediate withdrawal.

Despite Baghdad's demands, the Kurdish government has supported Turkey's military involvement and has friendly relations with Ankara.

Turkey argued that it had to send the reinforcements after receiving intelligence about possible IS attacks on the camp.

The attack on December 16 "shows once again the importance of security measures for the contingent" in Bashiqa, the Turkish Army said.

It said the four wounded soldiers were evacuated to a hospital in Turkey near the border with Iraq and none of them were in life-threatening condition.

In Washington, Colin Kahl, national security adviser to Vice President Joe Biden, condemned the IS attack on the training camp.

"Now more than ever, it will be important for Iraq and Turkey to accelerate their efforts to deescalate tensions, ensure dialogue remains constructive, reaffirm support for Iraqi security and sovereignty, and strengthen their cooperation against ISIL," Kahl said, using another recognized acrony for the extremist group.

Biden called Iraqi Prime Miister Haidar al-Abadi on December 16 about Baghdad's differences with Ankara. He and other U.S. officials have been working the phones for days, urging Iraq and Turkey to resolve their dispute, the White House said.