An Afghan soldier watches a ceremony marking the handover of the Canadian Panjwai task force to American forces in Kandahar province, southern Afghanistan, (Reuters).
Canada ended its combat mission in Afghanistan on Thursday, closing the curtain after nine years and the death of 157 men, saying it was "extremely proud" of gains made against the Taliban.
The departure of nearly 3,000 troops, who took on some of the heaviest fighting in the southern province of Kandahar, comes as Western forces begin to announce gradual drawdowns of troops ahead of a full withdrawal in 2014.
After spending more than $11 billion dollars on the war and with popular support sapped at home, most of the nearly 3,000 Canadian soldiers, based mainly in the dangerous battleground of Kandahar, have packed up and gone home.
A change of command ceremony was held at Kandahar airfield to mark the formal end of combat operations, although hundreds of other troops are being sent to work in a training role in the Afghan capital.
Afghan, Canadian and American national anthems were played to a small group of soldiers from each country, before commanders addressed the crowd and formally handed control of the mission to the United States.
"Over the years Canadians, both military and civilian, have made the ultimate sacrifice," Brigadier General Dean Milner, head of the Canadian combat mission, said in his speech to the assembled troops.
"All of these comrades would be proud to know of your accomplishments."
"Although there is still work to do, (we) are extremely proud of what has been accomplished."
Canadian soldiers first deployed to Afghanistan in early 2002, several months after a US-led invasion of the country to oust the Taliban in the wake of the September 11 attacks.
In recent weeks they have been completing their final patrols, packing up dusty outposts and gathering at the giant Kandahar airfield military base to debrief before starting to catch their flights home.
Britain is among other countries to have also announced partial troop withdrawals after nearly a decade of war, but the Canadians were the first major troop contributor to start sending forces home this year.
On Tuesday, Canada handed control of their last district to US forces in a flag-lowering ceremony, a key symbolic step in the drawdown process, although the Americans had been in place for weeks.
Last month, US President Barack Obama announced that he would withdraw 33,000 troops from Afghanistan by the end of 2012, while France and Belgium have joined Britain in stating that they will soon bring some soldiers home.
All foreign combat forces are due to leave by the end of 2014 and hand security to Afghan forces.
Canadian commanders insist they have made strong gains since they moved into Kandahar, the Taliban's birthplace and one of the war's fiercest hotspots.
Public opposition to the war in Canada has grown, with a poll earlier this year by Vision Critical/Angus Reid indicating that 63 percent of Canadians opposed it, compared to 47 percent in 2010.
Canadian Prime Minister Stephen Harper first pledged in 2008 that troops would leave this year.
After US forces killed Osama bin Laden in Pakistan in May, he said he believed Afghanistan was "no longer a source of global terrorism."
A separate Canadian training mission involving 950 troops will work in Kabul with Afghan security forces.
Canada will also continue to give aid to Afghanistan, with its overall involvement between now and the end of 2014 expected to cost around US$700 million a year.