A huge Canadian flag snapped in the wind Saturday outside an Ottawa cathedral where loved ones and dozens of uniformed soldiers said their final goodbyes to the soldier who was killed a week ago in Iraq.

Sgt. Andrew Joseph Doiron, known to those close to him as Drew, died March 6 after his special forces unit was surprised by the crack of gunfire in the night-time darkness from a group of Kurdish allies.

The peshmerga troops were part of the same local group Canadian soldiers have been assigned to train in the fight against the Islamic State.

Story continues below advertisement

Three other Canadian soldiers were wounded in what has been called a friendly-fire incident.

On Saturday, soldiers carried Doiron's urn to and from the cathedral in a silent, ceremonial manner that unfolded under the watch of a nearby military guard of honour.

Mourners who attended the private funeral service were greeted by a large Canadian flag that was raised across the street. It hung from the top of two extended fire-truck ladders and was flanked by two other Maple Leafs flying at half-mast.

Doiron's urn was to be buried later Saturday at the Beechwood National Military Cemetery in Ottawa.

The 31-year-old native of Moncton, N.B., was first Canadian soldier to die in the country's military effort in Iraq, which began last fall.

Doiron's death came just weeks before the military mission in Iraq is set to expire. The federal government is preparing to announce whether it will extend the campaign and, if so, how the mission might be shaped moving forward.

The elite special forces troops are helping Kurdish peshmerga fighters by guiding airstrikes against Islamic State fighters, a task the government doesn't consider combat. The Canadian soldiers have also been engaged in at least three firefights after coming under fire near the front line.

Story continues below advertisement

The program handed out at the funeral described Doiron as someone who adored skiing, motorcycles, physical fitness training and dogs — especially his "beloved Gretel."

The biography said Doiron enlisted in the Canadian Forces in 2002 and served with the 3rd Battalion Princess Patricia's Canadian Light Infantry in Edmonton. He was selected to join the Canadian Special Operations Regiment in 2006 after passing the demanding course.

He later completed three tours in Afghanistan. Doiron, the program said, spent a lot of time teaching and mentoring young soldiers.

"Known for his intellect and precision, he was meticulous in thought and action," the program said.

"He was a force that loomed larger than life."

After the funeral, three members of the Kurdish Youth Association of Canada stood across the street from the cathedral to pay their respects to Doiron. One young man held a sign that read, "Thank you for your sacrifice" and another man carried a poster that said, "Kurdistan mourns with you."

Story continues below advertisement

"Yes, he died on our soils, but he didn't die just for Kurdish people — and what he did, it was a heroic action," said Yusuf Celik, the association's vice-president.

"He was there to train people to build a safer Middle East for everyone, for all the ethnic groups and religious groups."

An obituary posted on the Beechwood website said Doiron left behind his parents, Raymond and Peggy, and his sister Lindsay.

"Andrew lived the warrior mentality and strived to be the best at whatever he chose to do," the obituary read.

"He lived and breathed the military, proudly serving Canada."

Canadian officials have said they don't expect the friendly-fire incident to affect the mission, even though their account of the events that led to the shooting differ from the version brought forward by the Kurds.

Story continues below advertisement

Kurdish officials have said their soldiers fired on the unsuspecting Canadians after they showed up near the front line unannounced. A peshmerga spokesman alleged the Canadians answered in Arabic when the Kurds asked them to identify themselves.

A senior Canadian government official later rejected that claim, saying Doiron's group had been at the same position earlier in the day and informed the Kurds they would return later that night. He added that not long before the shooting, the Canadians passed other peshmerga checkpoints close to the position where Doiron was killed.

Several investigations have been launched to get to the bottom of Doiron's death.

A military spokeswoman said Saturday that one of the soldiers wounded in the incident has returned to Canada to receive more medical treatment, but his life is not in danger.

"He's improving," Dominique Tessier said.

The other two injured soldiers, she added, remained in Iraq and are expected to return to duty once they've fully recovered.