A contingent of Canada's elite commandos were thrown into a day-long battle alongside Kurdish Peshmerga fighters as the Islamic State launched its biggest offensive in Iraq since western troops arrived in the region 18 months ago.

A three-pronged assault, involving hundreds of extremists, took place along a wide front in the sector, northwest of the Kurdish capital of Irbil, where Canadian special forces have been training local forces.

Overall, the surprise attack involved five locations — Nawaran, Bashiqa, Tel Aswad, Khazr and Zardik — according to local media reports.

A statement from Kurdistan Regional Security Council said "car bombs and mortars and rockets" were used to open up each attack on Wednesday and they were followed up by Islamic State fighters. In one area — Nawaran — extremists set off nine car bombs, according to local reports.

The Canadian special forces trainers laid down supporting fire to back up the Kurds as they undertook a counter-offensive Thursday.

"They came under effective fire and our guys were close enough and able to respond with fire on to those ISIL positions," said Maj.-Gen. Charles Lamarre in a hastily called briefing Thursday night.

There are 69 Canadian special forces trainers on the ground and the incident will likely re-ignite the debate about whether the troops are involved in combat.

Lamarre took pains not to characterize the fighting that involved Canadians as "combat," but sometimes there is no choice but to open fire.

"Our guys are always prepared because it's a dangerous environment and they need to defend not only themselves but the forces with which they are training and providing assistance," he said.

There were no Canadian casualties.

Last winter, the question of what constitutes "combat" was the subject of intense public debate after it was revealed Canadian trainers regularly visit the largely static front and exchanged fire with ISIS fighters, and helped guide in air strikes for Kurdish forces. The questions only became sharper when Sgt. Andrew Doiron was killed in a friendly fire incident in March.

Lamarre also confirmed that two Canadian CF-18s conducted air strikes near the occupied city of Mosul, the country's second largest city. The warplanes had been on a strike mission when they were called on to take out an ISIS fighting position that was supporting the extremist offensive.

U.S. media reports say American, British and French jets also flew strikes as the multi-pronged offensive against the Kurds dragged on for over 17 hours.

The size and scale of the offensive seems to have taken both the Kurds and the American-led coalition by surprise, especially at time when U.S. Defence Secretary Ash Carter was telling Kurdish media in Irbil that plans for the recapture of Mosul were proceeding well.

He painted an optimistic picture, saying the intense ISIS attack demonstrated to people in Irbil that extremists can and will strike at them, but the Peshmerga's effectiveness in repelling the assault showed through.

Lamarre was asked why, with all of the high-tech, western surveillance drones and spy planes — including a Canadian CP-140 Aurora — the offensive was not spotted in the build-up phase.

"I don't have all of the details yet of how this event took place in terms of the intelligence aspects," he said. "But there was sufficient warning for them to be able to react to it. That said, however, there was an element of surprise ISIL was able to bring to it."

Islamic State attacks in Paris and Lebanon last month were heralded as a major shift in strategy for the terror group. Lamarre wouldn't speculate on whether the massive offensive signals another new phase of the war.

Canadian participation in the fighting came as the new Liberal government is actively considering when to withdraw its six CF-18s from combat and how to beef up the ground training mission of local forces.

Lamarre wouldn't speculate on the timing of the withdrawal of the warplanes — or how the battle might affect the government's view.

Defence Minister Harjit Sajjan issued a statement late Thursday, commending the troops for responding to the "co-ordinated attack."

"These actions illustrate the valuable contribution our forces are making to the (Kurdish Security Forces) and the fight against ISIL," he said.