Canada formally ended its combat mission in Afghanistan on Thursday after years of being on the front lines of the fight against Taliban insurgents in the south.

The withdrawal of 2,850 Canadian combat troops comes at a time the Taliban continue to show their resilience, peace talks are in their infancy and governance and development are lagging security gains on the battlefield.

Underscoring the persistent dangers, a roadside bomb killed eight Afghan policemen on a patrol in the northern district of Fayz Abad. The police chief of the surrounding Jawzjan province, Abdul Aziz Ghyrat, said six policemen, including the unit's commander, were killed instantly and two died later at a hospital.

Northern Afghanistan had been relatively calm but has seen a rise in violence over the past two years.

Canada had been the sixth largest troop-contributing nation, behind the U.S. and European countries. While 2,850 Canadian combat troops are going home, 950 others have started streaming into the country to help train Afghan security forces.

Canada transferred its mission to the United States at Kandahar Air Field during a ceremony held in a hall decorated with Canadian maple leaf flags. After remarks, handshakes and the exchange of military paperwork, troops held a moment of silence for their fallen comrades. Since 2002, 157 Canadian troops have been killed in Afghanistan.

"It's safe to say that the country of Afghanistan remains volatile," Canadian Defence Minister Peter MacKay said in a telephone interview. "There have been very hard fought gains made as far as the stability and security, but it is fragile and much of the responsibility rests, of course, with the government of Afghanistan."

MacKay said the process of training Afghan forces to take the lead in providing security across the country was well under way.

cp-kandahar-handover-220

Brig.-Gen Dean Milner, commander of Canadian Forces Kandahar, gestures as he leaves after a transfer of command authority ceremony in Kandahar on Thursday. (Rafiq Maqbool/Associated Press)

"But it is the professionalism and their ability to secure some of these particularly violent regions like Kandahar that will be the telling feature as to whether the security will last," he said. "Certainly the desire is there on the part of the Afghans themselves.

"They are enormously respectful and grateful of the contributions that Canada has made, and of course they don't want to see Canada leave."

With more than 90,000, the United States has the largest number of troops in Afghanistan. President Barack Obama announced last month that 33,000 American troops will leave the country by the end of next summer.

British Prime Minister David Cameron announced Wednesday that the U.K. will withdraw 500 troops from Afghanistan by the end of 2012, a move that will reduce the size of the British contingent in the country to 9,000.

There currently are 4,812 troops in Afghanistan from Germany; 3,935 from France; and 3,880 from Italy.

The U.S.-led coalition reported that a service member died Thursday as a result of a non-battle related injury in southern Afghanistan. No other details were disclosed about the death, the 10th so far this month. A total of 281 coalition troops have died so far this year.

In eastern Afghanistan, a NATO helicopter crashed Thursday in Parnwan province, but the crew was recovered and no one was injured, the coalition said.

NATO said the cause of the incident was under investigation.

The Taliban claimed its fighters shot down the aircraft, but the coalition said that initial reports indicated no militant activity in the area.

Continues fighting

Also in the east, several hundred villagers, chanting slogans against the U.S. and Afghan governments, protested the deaths of civilians in a coalition airstrike earlier this week in Khost province.

The civilians were killed Tuesday during a fight between insurgents and an Afghan-led security force, which was searching for a leader of the Haqqani network, a militant group affiliated with the Taliban and al-Qaeda.

A coalition helicopter was called to support ground troops, who were being hit with rocket-propelled grenades and small arms fire. The coalition said the helicopter killed several of the insurgents and unintentionally, some members of the insurgents' families who were living with the fighters.

Gen. Raz Mohammad Oryakhail, an Afghan army commander in Khost, said 13 people — including the Haqqani leader, six of his fighters and members of their families — were killed in the strike in Shamul district.

With files from CBC News