More than 270,000 ex-soldiers were short-changed by Veterans Affairs Canada for over eight years because of an accounting error worth at least $165 million, CBC News has learned.

The mistake was uncovered by the veterans ombudsman's office, which has worked with the federal department for over a year to get it to confirm the mistake and make amends.

A written statement from Veterans Affairs Minister Seamus O'Regan confirmed a retroactive compensation program is in the works — but the affected veterans will have to wait up to two years to get their money.

"We will ensure those affected receive the compensation to which they are entitled," O'Regan said. "At this stage, given the number of individuals affected, we expect to issue payments by 2020. We will share more information with those affected as it becomes available."

The minister thanked the ombudsman, Guy Parent, for uncovering the error.

"Our interest is that veterans and their families are treated fairly," said Parent in an interview Monday with CBC News.

Canadian Veterans Ombudsman Guy Parent says many of the veterans short-changed by Ottawa are — or were — living on low incomes. (Adrian Wyld/Canadian Press)

The error was made in the monthly indexing calculation on disability awards and pensions and is believed to have started as far back as 2002.

The department didn't factor in the basic provincial tax credit for individuals. That led to lower monthly payments for 272,000 veterans — a significant number of them Second World War and Korean War veterans.

As many as 175,000 of them have since died, leaving the federal government with a legal mess to untangle related to their estates.

"It's going to be a challenge," Parent said.

Depending upon individual circumstances, the ombudsman said, the error would have deprived veterans of between $50 and $2,000 during the timeframe.

"Those war veterans that are in low income and that receive the war allowance ... I mean, two thousand dollars is almost the equivalent of a monthly payment for them," the ombudsman said. "It is significant for them."

The error ran unchecked from 2002 to 2010, according to internal department numbers analyzed by the ombudsman's staff.

In 2011, Veterans Affairs inexplicably resumed using the correct calculation.

The department did not, however, make any move to reimburse veterans for the lost income, which would have — in the worst cases — amounted to a few hundred dollars per month.

"We did not look really look at causes ... We did not look at the how or the why," said Parent. "We discovered the error. They acknowledged it and now our interest is in fairness and making sure they are repaid and the money goes back into veterans' pockets."

Parent said it is up to Veterans Affairs to explain why the error took place, when it was spotted and why nothing was done about it until the ombudsman stepped in.

Conservative defence critic James Bezan was caught off guard by the news and claimed two former veterans ministers, who served through the time when the mistake was spotted, knew nothing about it.

"They were never, ever briefed on this," said Bezan, who demanded more details on the Liberal government's compensation plan.

Sean Bruyea, a veterans advocate and long-time critic of the department, said he wonders what would have happened had the ombudsman not dug into the file and whether the department was trying to hide its mistake.

"They were waiting for someone to hopefully not find this information," he said. "And when it was found, the fact that they're not being agile and responsive to get this solved, paints a picture of a department that's sorely out of touch with how it impacts veterans."

Canada's former top military commander, retired general Rick Hillier, said he is willing to believe the miscalculation was an honest bureaucratic snafu, but he still has questions.

"You do wonder why it took so long to recognize it was an error and why there wasn't some … compensation at the end of it," Hillier said.

Some veterans did end up receiving reimbursement — but inadvertently, and without knowing it. The Liberal government's 2016 budget poured more money into disability awards, and the measure included retroactive payments.

But the ombudsman said the difference was not made up for those who received disability pensions between 2002 and 2010.