KABUL, Afghanistan - Canada has pulled out its last military operation in Afghanistan, ending a 12-year mission to the country.

The Canadians formally ended their combat role in southern Afghanistan in July 2011 but maintained a small training operation in Kabul. That operation ended Wednesday.

At its peak Canada was the sixth largest troop-contributing nation, behind the U.S., Britain, Germany, France and Italy. It deployed more than 40,000 service members to Afghanistan since the mission began in 2001. Like Americans and Europeans, Canadians have grown weary of the war.

According to the Canadian government, 158 soldiers, one diplomat, one journalist and two civilian contractors were killed in Afghanistan.