OTTAWA - Two kidnapped Canadian diplomats were whisked to freedom across an African desert as questions swirled about whether money was paid to al-Qaida to secure their release.

Prime Minister Stephen Harper told reporters late Wednesday that Canada did not hand over ransom cash or prisoners for the release of Robert Fowler and Louis Guay -- but he wouldn't say if any other governments did.

Harper said the governments of Mali and Burkina Faso negotiated the release of the men, but wouldn't say much more.

"The government of Canada does not pay ransom or money, the government of Canada does not release prisoners. What efforts or initiatives may have been undertaken by other governments are questions you'll have to put to those governments."

Fowler and Guay were released in northern Mali after a four-month ordeal and were being transported by security forces across the desert region toward the capital, Bamako, the Malian government said.

Relatives said Fowler, a prominent UN envoy who served as adviser to prime ministers, was planning a reunion with his wife and daughters in Europe.

The diplomats were kidnapped in neighbouring Niger while on a UN mission in December. Al-Qaida militants later claimed responsibility.

A spokesman for Mali's president said the kidnappers released four foreign hostages, including the two Canadian UN staffers and two women tourists nabbed in a separate incident this year.

The federal government refused to confirm that Fowler had been released until Harper held an evening news conference.

"I know that all Canadians join with me and the families of Mr. Fowler and Mr. Guay in rejoicing in this wonderful news," Harper told reporters, adding that he spoke to the wives of both men.

Asked about reports that Mali negotiated with al-Qaida, Harper responded: "A negotiated release of the hostages was preferable to just about every other conceivable option in this case."

He said the release came after a lot of work by officials from many federal departments.

The release of the high-ranking diplomats prompted jubilation and relief among foreign-service colleagues. During their long disappearance, friends had feared the worst.

Peter Harder, once the top civil servant in the Foreign Affairs Department and a longtime friend of Fowler, was elated.

"Wow, terrific. This is just wonderful news," he said.

"He's a public servant of huge distinction, having endured an almost unimaginable plight over the last four months. He and his fellow hostages being released is a tremendous relief."

One report said the diplomats stopped in a town on the edge of the Sahara on their way to the capital, and that local witnesses said they displayed no signs of physical harm.

Liberal MP Dominic LeBlanc said Fowler's wife, Mary, and his four daughters were already preparing for a reunion in Europe.

"The family is certainly very enthusiastic about the news that they've been given," said LeBlanc. "I know that they're looking forward to hopefully reuniting with Bob in the coming days."

His father, ex-governor general Romeo LeBlanc, is Fowler's brother-in-law.

LeBlanc credited the governments of Canada, Mali and Burkina Faso for working to save the diplomats. He cautioned, however, that it was too early to tell whether they had been harmed in captivity.

"The family doesn't have any information on (Fowler's) state of health or his condition," he said.

"Obviously, that's been a source of concern since the beginning of this difficult situation in December. That's probably why they're so anxious to be physically with him in the coming days."

In February, al-Qaida in the Islamic Maghreb claimed in an audio tape played on the Al-Jazeera television network that it was holding the two Canadians hostage.

It made no demands at that time, but in the past has received ransoms for western tourists kidnapped in the vast sub-Saharan region.

Harder declined to say whether the Canadian government would pay ransom in a case like this, adding it would be irresponsible to speculate publicly on such a matter.

Fowler, Guay and their UN driver, Soumana Moukaila, disappeared in mid-December when returning from a visit to a gold mine. The driver was released last month.

Their car was found abandoned about 50 kilometres northeast of Niger's capital, Niamey.

Four Europeans -- two Swiss, a German woman and a British man -- were also kidnapped in January on the Mali-Niger border.

Rebels seeking to overthrow Niger's democratic government at first claimed, and then denied, responsibility for kidnapping the Canadians.

The claim was published -- then recanted -- by a rebel group that says uranium mining companies from Canada and other countries are pillaging their land without proper compensation for residents.

Fowler, 64, worked with Pierre Trudeau on the former prime minister's international peace mission before he left office in 1984.

He rose to become the most senior civilian official in the Defence Department under Brian Mulroney, and served as Canada's ambassador to the United Nations from 1995 to 2000.

He was instrumental in helping Canada gain a temporary seat on the UN Security Council, Harder said. He then used that prestigious seat to help halt the international trade of Angola's so-called blood diamonds.

Fowler was travelling in Niger as the UN's special envoy to that country when he and the others disappeared.

It appeared at first that their abduction stemmed from a complex conflict involving the government of Niger, rebel groups and international mining companies.

A handful of Canadian companies own 40 per cent of Niger's mining permits, according to statistics from the Foreign Affairs Department. Fowler and his travelling companions were visiting one of those uranium sites the day they were taken.

Local people say they have not received a fair share of the royalties from uranium, which accounts for more than two-thirds of Niger's exports.

Western intelligence officials in Algeria told The Associated Press in February that they believe the UN diplomats were initially abducted by local gunmen, bandits or Tuareg rebels, and later traded to the al-Qaida group.

Al-Qaida in the Islamic Maghreb is an Algeria-based militant group that joined Osama bin Laden's terror network in 2006.