Two Iraqi volunteers were killed and about four Turkish soldiers sustained injuries when Islamic State (IS) militants fired mortars on a training camp near the Iraqi city of Mosul, Turkish officials said.
Militants attacked the Bashiqa camp where Iraqi anti-jihadist fighters were being trained with Turkish help.
“We offer condolences to our Iraqi martyr brothers’ families and the Iraqi people, and wish the injured a speedy recovery,” the Turkish foreign ministry said in a statement.
IS -- which counts Mosul as its main Iraqi hub -- claimed responsibility for the assault in a statement posted online, although it said it used rockets rather than mortars.
“Soldiers of the caliphate were able to launch 200 Grad rockets,” the statement said in reference to the Islamic “caliphate” the jihadist group has declared in parts of Iraq and Syria.
Powerful Shiite militia Ketaeb Hezbollah also claimed responsibility for the attack via its TV channel Etejah, but did not specify how it managed to shell a base located over 100 kilometres (60 miles) north of the northernmost positions held by federal forces and allied militiamen.
Turkey is widely perceived among Iraq’s Shiite majority as complicit with IS, and Shiite militias have advocated using force against Turkish troops should they refuse to withdraw.
The military said it responded to the attack on the camp with fire of its own, adding that the four wounded Turkish troops had been taken for treatment in Sirnak province, on Turkey’s side of the border.
“We are pleased to confirm that their condition is stable,” a Turkish official told AFP on condition of anonymity, emphasising that the attack originated from IS-held territory.
According to CNN-Turk television, IS jihadists fired up to 60 mortar rounds over several hours.
One of the Turkish troops was seriously wounded but his life is not in danger, it added.
Turkish President Recep Tayyip Erdogan was briefed by army chief Hulusi Akar on the attack, the state-run Anatolia news agency reported.
Iraqi Kurdish officials said the shelling in the Bashiqa area was part of a multi-pronged attack by IS 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, said Jabbar Yawar, the secretary general of the ministry responsible for Kurdish peshmerga forces.
Turkey sparked a bitter diplomatic row with Baghdad earlier this month when it announced the deployment of hundreds of troops to Bashiqa, where it has a long-running training programme for anti-IS forces.
Ankara insists the deployment was routine and necessary to protect the Turkish military trainers, while Baghdad said it was unauthorised and demanded the troops be withdrawn, protesting to members of the UN Security Council.
The Turkish army said Wednesday’s attack “shows once again the importance of security measures for the contingent” in Bashiqa.
In a bid to placate Baghdad, an unspecified contingent of the Turkish troops this week pulled out of the camp and headed northwards.
The move came after Turkish Prime Minister Ahmet Davutoglu last week sent foreign ministry under-secretary Feridun Sinirlioglu and intelligence chief Hakan Fidan to Baghdad to settle the tensions.
But the Iraqi government demanded the “complete withdrawal” of Turkish forces from its territory, indicating Ankara’s partial pullout was not enough.
By contrast, the deployment has been supported by the Kurdistan Regional Government (KRG) which controls the northern Iraqi region and has excellent relations with Ankara.