Canada took part in an international operation to secretly remove deadly chemicals – often turned into weapons – from Libya to keep them out of the hands of Islamic State fighters.

The disarmament mission concluded last week when a Danish ship unloaded 500 metric tonnes of the chemicals at a German port for destruction at a commercial facility in the city of Munster over the next nine months. The maritime operation also involved the British, Spanish and Italian navies.

Canada provided $725,000 to the multinational effort. Some of that money went to buy 20 new safe chemical tanks, fitted with GPS tracking devices. The tanks containing the hazardous chemicals were taken by armed convoy across the desert to the coastal city of Misrata, Libya, and onto Germany in utmost secrecy.

Story continues below advertisement

Related: UN inquiry blames Syrian government for gas attacks

Globe Archives: A century of WMDs: How Ypres changed warfare forever

Officials involved in the operation provided details to The Globe and Mail on Canada's role.

"This operation happened because Canada was able to buy these new tanks for transferring the materials and also the U.S. donated some tanks as well," said Deepti Choubey of the Hague-based Organization for the Prohibition of Chemical Weapons, which co-ordinated the operation. "It is a huge success story. "

The United States, European allies and Canada became alarmed in May when Islamic State militants killed two security officers at a checkpoint about 1.6 kilometres from Libya's sole remaining chemical-weapons site in Ruwagha.

"ISIS was operating very close and we knew it was a matter of time when they would attack the site because the site is also a huge bankers bazaar of conventional weapons," Libya's representative to the OPCW, Ali Gebril, told The Globe and Mail. "That's why we started a very serious process and Canada was one of the partners who supported us financially and played an active role in the consultations."

The United States and its allies were concerned because the chemicals, which included phosphorus trichloride and 2-chloroethanol, could be turned into 100 metric tonnes of nerve agent and 30 metric tonnes of sulfur mustard, commonly known as mustard gas.

Story continues below advertisement

Officials were already aware that the Islamic State had used sulfur mustard in Syria in 2015 and feared they would raid the Ruwagha site to obtain the chemicals.

The operation was not without danger. Some of the chemicals were stored in 25-year-old barrels that had corroded and were leaking. The Islamic State also has lookouts along the route from Ruwagha to Misrata.

"The [largest] concern was how to remove the chemicals from location in Ruwagha to the north. It was a huge challenge because of the ongoing battle between the Libyan forces and [IS]," Dr. Gebril said.

The Libyans transferred the chemicals to the Canadian tanks in mid-July and then to an unidentified safe storage site before they were shipped to Misrata and loaded on the Danish ship in late August.

Libyan officials had hoped to destroy the chemical precursors by using sophisticated Canadian plasma technology, but the deal fell through because of Islamic State attacks and waves of kidnappings.

"We had a very successful negotiation in Canada. We got an offer but unfortunately the situation in Libya was very dangerous to bring such technology to Libya to deal with these chemicals," Dr. Gebril said.

Story continues below advertisement

The removal of the last of Libya's chemical weapons came as U.S. fighter jets continue to pound Libya's coastal city of Sirte, an Islamic State stronghold.

Canada has played a leading role in the elimination of Libya's chemical weapons program since 2012, when it contributed $6-million to the OPCW, the global chemical-weapons watchdog.

"We commend the OPCW for co-ordinating this complex undertaking and Libya's Government of National Accord for in requesting and then facilitating the removal of these chemicals," Foreign Affairs Minister Stéphane Dion said in a statement to The Globe and Mail.