IRBIL, Iraq -- Canadian and Kurdish officials on Sunday offered conflicting accounts of the death of a Canadian soldier in a friendly-fire incident in Iraq, with the Kurds saying he was on the front lines directing airstrikes and the Canadians saying he was not there to direct airstrikes that night and was well behind the front line when shot by Kurdish fighters.

The death of Sgt. Andrew Joseph Doiron on Friday marked Canada's first casualty as part of the U.S.-led coalition's war on the extremist Islamic State group. Three other Canadian soldiers were injured in the incident.

Kurdish officials said Sunday that Doiron was killed after he and other Canadian soldiers showed up to the front line unannounced to call in airstrikes.

"They went to the front line to direct airstrikes because the area was attacked by ISIS the day before," Hezhar Ismail, director of co-ordination and relations for Kurdish peshmerga forces, told The Associated Press, using an acronym for the Islamic State group.

Peshmerga spokesman Halgurd Hekmat said a group of Canadian soldiers showed up unannounced Friday to the village of Bashiq in Iraq's Nineveh province near the militant-held city of Mosul. The area had seen heavy fighting against Islamic State group militants the previous day.

"When they returned, the peshmerga asked them to identify themselves," Hekmat told the AP. "They answered in Arabic, that's when peshmerga started shooting. It was their fault."

Hekmat said he doesn't know why the Canadians were there. "I consider it an improper action by the Canadians, and illogical," he said.

But Canadian Defence Minister Jason Kenney and a senior Canadian military official said the soldiers had returned to an observation post at least 200 metres behind the front line.

The senior military official, who spoke on condition of anonymity because they were not authorized to speak publicly, said the Canadian soldiers were at the same observation post earlier in the day and co-ordinated with the Kurdish soldiers on how they would return that evening and what signals they would give. The official said the soldiers successfully passed through two Kurdish positions before reaching the third post, where they were fired upon.

"They got lit up by one guy for reasons that are unknown to us," the official said. "Once he started shooting, some other fellows from the Kurds engaged and that's when the injuries occurred."

The official said the Canadian soldiers were not at the front line to direct airstrikes that night. When asked if they were scouting potential airstrike targets, he declined to say what they were doing.

The three injured soldiers were in stable condition. Two remained in Irbil, and the third was flown to Germany for treatment. The official said Doiron's body won't be flown back to Canada until Tuesday at the earliest.

Canada has 69 special forces soldiers with Kurdish peshmerga fighters in what the government calls an advising and assisting role. They were sent to help train Kurdish fighters last September in a mission that was billed as noncombat, with the elite troops working far behind the front lines.

But the Canadian soldiers have been helping the Kurdish fighters by directing coalition airstrikes against Islamic State group militants, a role generally considered risky because it means they are close to the fighting.

The fact that Canadian special forces have been on the front lines has stirred controversy in Canada, but Kenney said the rules of engagement will remain the same. The Canadian government is expected to extend the mission later this month.

The United States has conducted the vast majority of the airstrikes against the Islamic State group but has thus far been unwilling to direct the airstrikes from the ground. Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, has repeatedly said the U.S. would consider it.

The senior Canadian military official said Canada isn't the only coalition nation that is directing airstrikes from the front lines. He declined to say who else is doing it.

The Islamic State group currently holds a third of Iraq and Syria. The U.S.-led coalition began airstrikes targeting the extremists in August.

So far, four other troops have been killed as part of the coalition, not counting Iraqi forces. They include a U.S. Marine presumed lost at sea in October, a Marine killed in a noncombat incident in Baghdad in October, a U.S. Air Force pilot killed in December when his jet crashed in Jordan and a captive Jordanian pilot burned to death in a cage by the Islamic State group.