Once contaminated with tens of thousands of land mines from a legacy of war, Mozambique was officially declared cleansed of those weapons on Thursday after 22 years of work.

The achievement, celebrated at an event in the capital, Maputo, was considered especially remarkable by disarmament advocates. Some had regarded Mozambique as so riddled with land mines that clearing them would perhaps take centuries.

A few decades ago, “many doubted that clearance could be completed in a timely fashion — or that it would take hundreds of years,” said Megan Burke, director of the International Campaign to Ban Landmines — Cluster Munition Coalition, a leading advocacy group.

Most of the clearance work was done by the Halo Trust, a Scotland-based international organization that helps former conflict zones cleanse themselves of land mines and other vestiges of war that can kill and maim long after the combat has stopped. Teams are still at work, for example, clearing World War I battlefields of unexploded ordnance.