A former Canadian ambassador has questioned the ethics of a Canadian company's sale of dozens of armoured vehicles to South Sudan's military, which deployed them in a civil war that has killed tens of thousands of civilians.

In a newly published memoir, Nicholas Coghlan said he spoke to Ottawa officials and raised questions about the armoured vehicles sale when he learned of it while he was serving as Canada's ambassador to South Sudan.

The Globe and Mail reported last year that Canadian-owned Streit Group had sold the vehicles to South Sudan, where they were used in combat. A report by United Nations experts last year said South Sudan had purchased 173 armoured vehicles from Streit in 2014, after the war began.

Story continues below advertisement

Read more: Canadian company sold armoured vehicles to South Sudan: report

Mr. Coghlan said he was tipped off to the export deal in early 2015 by someone on social media who sent him a photo of the South Sudan military using the armoured vehicles to attack rebel positions.

"I followed up and the allegation was correct," Mr. Coghlan writes in his book, Collapse of a Country, published this month by McGill-Queen's University Press.

Lawyers in the federal government told him the vehicle export could not be prohibited by export-control laws because the vehicles were manufactured at an overseas Streit factory in the United Arab Emirates, even though the company itself was Canadian, he said.

"The legal case was watertight; it seemed to me that the ethical case was not," he wrote in the book.

He also noted the vehicle export made it possible for people to accuse Canadian diplomats of "hypocrisy" for criticizing South Sudan's crimes while a Canadian company was simultaneously selling arms to the country.

UN reports and other human-rights reports have documented a long pattern of massacres, rapes and destruction by South Sudan's army since the war erupted in December, 2013. It has become one of the bloodiest wars in the world.

Story continues below advertisement

Over the past two years, The Globe has investigated a series of Canadian arms exports to countries with poor human-rights records, including a $15-billion deal to sell weaponized armoured vehicles to Saudi Arabia.

Mr. Coghlan's book contains some ominous warnings for the future of South Sudan if the civil war continues. He quotes the retired Canadian lieutenant-general Roméo Dallaire, commander of UN peacekeepers in Rwanda during the 1994 genocide, who visited South Sudan in 2015 and told him that he noticed similarities between South Sudan and pregenocide Rwanda.

The former ambassador described one of South Sudan's war-ravaged cities, Malakal, as a haunting vision of what the entire country could become: "a lawless wasteland where all that mattered was your ethnicity and the calibre of your weapon."

Mr. Coghlan was first posted to South Sudan's capital in 2012, a year after it won independence and became the world's newest country. He served as head of the Canadian office for two years, was formally appointed ambassador in 2014 and completed his term last summer.

Canada and other Western countries were strong supporters of South Sudan after its independence, but failed to see the growing likelihood of bloody internal conflict as its leaders feuded.

Analyzing how the country collapsed into war within two years of its independence, Mr. Coghlan says the donor countries – including Canada – failed to put enough emphasis on the process of peace and national reconciliation inside South Sudan in 2012 and 2013.

Story continues below advertisement

When the war erupted, the UN and humanitarian agencies soon became "scapegoats" and targets for the warring parties, Mr. Coghlan says. Dozens of humanitarian workers were killed, food convoys were looted and relief agencies were harassed by government troops and rebels as the agencies tried to provide aid to starving civilians.

In one incident, South Sudanese soldiers hijacked and looted a large convoy of UN food aid, including $300,000 (U.S.) in Canadian food aid, Mr. Coghlan said. But the UN insisted that the attack should be kept quiet, so that the UN wouldn't jeopardize its difficult relationship with the government.

In another incident, after Uganda sent troops and military equipment to help South Sudan's government, a Canadian doctor of South Sudanese origin was killed by a rocket from a Ugandan helicopter, Mr. Coghlan said.

Mr. Coghlan makes it clear that he disagreed with some of the Canadian government's own decisions at the beginning of the South Sudan crisis, when Stephen Harper was prime minister.

After the war began in mid-December of 2013, hundreds of panicking Canadian citizens sought desperately to leave the country, and the Canadian Department of National Defence offered to send a C-130 Hercules aircraft to help evacuate the Canadians. But the offer was rejected by Mr. Harper's foreign minister, John Baird, forcing the Canadian diplomats into the "embarrassing" position of depending on the generosity of other countries that were sending airplanes, Mr. Coghlan said.

Later that month, he said, Ottawa ordered him and his wife to leave the country immediately, refusing to listen to his request to stay and help the remaining Canadians, even though his workload with the desperate Canadians was as heavy as ever.

Story continues below advertisement

After he relocated to neighbouring Kenya, it took "lengthy and tedious negotiations with a risk-averse HQ" before he was allowed to make brief visits back to South Sudan to help evacuate more Canadians, he said.