Last week, during the NATO summit in Brussels, Prime Minister Justin Trudeau ruled out sending Canadian troops back to Afghanistan — despite requests from NATO commanders that member states contribute more soldiers to an ongoing training mission.

"Canada has always been recognized as one of the go-to partners in NATO," Trudeau said, while essentially suggesting the alliance "go to" some other partner because Canada has already done its share.

This is a mistake. Afghanistan — a country that 158 Canadian soldiers died defending — is teetering on the edge of a dark abyss.

On Wednesday morning, a vehicle bomb in the diplomatic quarter of the capital, Kabul, killed at least 90 people and wounded hundreds. Reports suggested most of the dead are civilians. The Canadian embassy suffered "significant damage," according to a spokesperson for Foreign Affairs Minister Chrystia Freeland, though Trudeau said Canadian embassy staff are safe and accounted for. More than 360 people have died in attacks in Kabul since last June. This attack appears to be the deadliest.

Blast occurs near embassies, presidential palace 1:00

Even without Canada's participation, Operation Resolute Support — NATO's support mission in Afghanistan — is NATO's largest current deployment, one that involves 13,000 personnel from member states and partner nations. It's a priority for the alliance. And Canada is particularly well-suited to it. Trudeau's past rhetoric suggests he knows as much.

While attempting to explain back in 2015 why he would end Canadian airstrikes against the so-called Islamic State group in Iraq and Syria, Trudeau said Canada would instead offer what it has "demonstrated tremendous ability at in Afghanistan and elsewhere: training local troops doing the fighting on the ground."

Now Afghanistan needs the sort of training Canada once provided; the training Trudeau says this country is so good at.

Lingering instability

Wednesday's atrocity in Kabul is only the most recent that Afghanistan has suffered in the past few months. The Taliban, which has denied responsibility for the bombing, is resurgent. A newly established branch of ISIS has launched numerous attacks in Kabul. Afghanistan's security forces are better than they once were, but are still unable to secure their country without help.

The "tremendous ability" Canada demonstrated in Afghanistan did not come easily. It grew out of more than a decade of battlefield and training experience, mistakes, learning, adjusting and sacrifice.

That makes the call to return there difficult to accept. Canadians can look at the ongoing insurgency, the corruption, the lack of a political settlement on the horizon and wonder what was the point of intervening there in the first place.

But this ignores what has been accomplished. For all the setbacks and frustrations, Afghanistan is a more hopeful place today than it was on September 10, 2001.

Far more girls school attend school in Afghanistan than would have if the Taliban still ruled Kabul. (Alex Brandon/Associated Press)

Fewer infants and mothers die. Afghanistan's infant mortality rate was 95 deaths per 1,000 live births in 2000. In 2015, it was 66 deaths for every 1,000 births. What's more, Afghanistan is no longer the base for international terrorism that it was before al-Qaeda was routed (though inroads made by ISIS could change that). There has been a peaceful and democratic transfer of power for the first time in the country's history. And while far fewer girls probably attend school than the Afghan government has claimed, it's clear that far more do than would if the Taliban still ruled Kabul.

Giving up on Afghanistan also avoids confronting just how long it often takes to end insurgencies and civil wars and rebuild nations. In Colombia, a peace deal last year concluded a conflict that had persisted for more than five decades.

Canadians soldiers carry prepare to leave the Kandahar airbase in Afghanistan, in July 2011. Canadian troops transitioned from a combat to a training role that year and withdrew from the country altogether three years later. (Rafiq Maqbool/Associated Press)

Progress in Afghanistan will be measured in generations. And long-term progress requires long-term commitments. Canadian soldiers' deployments in Afghanistan, generally six-month tours, were too short. Understanding a mission and nurturing relationships with locals take time, and a constant rotation of troops undermines this process. But over the years Canada was in Afghanistan, it built expertise and institutional memory. Afghanistan, and Canada's NATO partners in that country, would benefit from that now.

For a while, it seemed that Trudeau would instead put what Canada learned in Afghanistan to use in a United Nations peacekeeping mission somewhere in Africa, probably Mali, a country the UN is trying to stabilize in the face of an Islamist insurgency.

Trudeau appears to have developed cold feet of late, recently noting Canadians have a "difficult history in Africa as peacekeepers" and cautioning that he would not "fast-track" a decision to send Canadian soldiers there, despite previously expressing great eagerness to do just that.

Afghanistan needs Canada's help

Still, Canada's participation in a UN peacekeeping mission in Africa at least remains on the table for Trudeau, while a return to Afghanistan is something he says he won't consider.

Trudeau last year pledged to "revitalize" Canada's role in peacekeeping, something that would allow him to differentiate his foreign policy from that of his predecessor, Stephen Harper. And he likely sees Canadian participation in UN missions as a way to bolster Canada's bid for a seat on the United Nations Security Council in 2021.

But such considerations shouldn't influence where troops are deployed. Canada's ties to Afghanistan are stronger than are those to Mali. The need for Canada's help is greater there. And Canada's obligations to NATO — despite Trudeau's evident fondness for the idea of peacekeeping, if not its messy reality — are more important than is Ottawa's commitment to the United Nations. Canada should join its closest allies and return to Afghanistan.

This column is part of CBC's Opinion section. For more information about this section, please read this editor's blog and our FAQ.