OTTAWA -- The Trudeau government has ordered National Defence to repay more than $147 million in unauthorized expenses incurred by members of the military over nearly a dozen years, The Canadian Press has learned.

The department acknowledged five years ago it had made a mistake when it allowed soldiers and civilian staff to claim some travel expenses and benefits that fell outside of federal guidelines.

The practice went on between April 1999 and January 2011, but was then halted following an independent analysis.

At the time, the military said the mistake involved "tens of millions of dollars" over five years and that it would try to get the federal Treasury Board to cover the expenses, which included the cost of sending family members of fallen Canadian soldiers to visit Kandahar during the war in Afghanistan.

Other expenses included reimbursing travel fees for troops deployed in different parts of Canada, bonuses for overseas postings and allowances for soldiers assigned away from families.

The deputy commander of the military, the now-retired vice admiral Bruce Donaldson, said in 2011 that he was hopeful Treasury Board -- the department that manages federal spending -- would retroactively approve many, if not all, of the payments in order avoid forcing members to pay back the money.

While no one in the military will have to dip into their pockets, it seems National Defence lost the retroactive approval argument and has taken on responsibility for the debt itself.

No one in the department, or the Liberal government, could explain why the amount wasn't simply written off the federal books.

Jordan Owens, a spokeswoman for Defence Minister Harjit Sajjan, said she wasn't able to comment on what went on before the Liberals took over. But she said the department felt the need to assume responsibility for the error.

"Our request to Treasury Board was that DND will pay back these debts, over the course of several years," she said.

"Partisan politics aside, I don't think anyone thinks (Canadian Armed Forces) members should be liable for money they believed they were receiving in good faith."

Dave Perry, an analyst with the Canadian Global Affairs Institute, was startled not only by the figure, but also the fact that the debt stretches back over 17 years.

"It's beyond bizarre that you be going back that far," Perry said.

"I don't understand what the point might be. It is money that was authorized by Parliament over the course of three governments and spent. And it seems to be a case of the left hand of government giving money to the right hand."

Part of it seems to be a regulatory, for-the-record exercise that formally absolves members of military from having to repay the cash themselves. Those who received the payments have been released from liability by the cabinet order, said National Defence spokeswoman Laura McIntyre-Grills.

What she did not reveal was how many years it will take the department to repay the debt.

Perry said he is concerned what -- if anything -- National Defence will have to forgo as a result of its decision to assume the liability.

"There are all kinds of good things that could have been planned with this money," he said. "Will this impact training? Will it impact national procurement funding?"

One of the reasons it has taken five years to sort out the issue is that after the error was discovered, defence officials ordered a more comprehensive assessment of the benefits system, said McIntyre-Gills.

"In 2011, the DND and the CAF discovered specific payment errors during a standard internal audit," she said.

"This initial discovery resulted in a more extensive review of other benefits and, thus, subsequent discoveries of unauthorized payments. In 2011, an independent external agency reviewed the circumstances of the unauthorized payments and found no evidence of wrongdoing, and that benefit payments had been made in good faith."