The government will begin issuing $721 million worth of refunds to people who had money taken through the automated debt recovery program known colloquially as ‘robodebt’.

Government Services Minister, Stuart Robert, made the announcement in a last-minute press conference late Friday afternoon, saying the government will refund 470,000 debts from 373,000 Australians from the start of July.

“We're doing that because the best advice we have is that raising a debt wholly or partly on the basis of ATO incomed average, or averaged income, is not sufficient under law,” Robert told a small contingent of journalists on the Gold Coast.

“So therefore, we will return that money and move forward with our income compliance program with further proof points to ensure it remains sufficient.”

In November last year, the government paused its use of automated debt recovery not long before the Federal Court found the robodebt scheme to be unlawful.

The court concluded that the government could not rationally determine a debt had arisen using its algorithm that matched Centrelink data with ATO records and averaged a person’s reported taxable income across a 12-month period.

If the system detected a discrepancy between the welfare recipient’s averaged taxable income and the income they reported to Centrelink, it would automatically issue a debt recovery notice to the person.

When asked why it took six months for the government to take action after the Federal Court's decision, Robert said it had “taken a while to identify all of the 373,000 Australians” affected by the unlawful scheme.

“We wanted to get that right,” he said. “We wanted to also build out the platforms needed to do a large-scale refund, something that the Government has not generally done in the past.”

Robert’s cynically-timed announcement came just prior to a scheduled court-ordered mediation between the government and plaintiffs of a class-action lawsuit seeking compensation for the scheme’s undue harm.

Leaked documents seen by The Guardian reportedly show the public service urged government ministers to scrap the robodebt scheme, saying refunded debts would “reduce the incentive for the applicants to persist with the class action, and minimise the commonwealth’s potential liability for interest and legal costs”.

Shadow Government Services Minister, Bill Shorten, said the scheme has caused “pain and trauma" for ordinary Australians.

“The government, for the last four-and-a-half years, has been holding people’s money illegally,” Shorten said.

“It has been charging people penalty fees, and the whole basis for the government to take money off vulnerable Centrelink recipients was illegal.

“People have lost jobs, people have lost relationships, people have suffered psychological injury, people were not allowed to go overseas – all on the basis of illegal government debt notices."

The scheme had long been highly criticised for the needless harm it caused people with whom it raised the unlawful debt.

In one instance, debt collection notices allegedly contributed to the suicide of 28-year-old Melbourne musician and florist, Rhys Cauzzo.

Debt collectors even tried to get money from the mother of deceased disability pensioner, Bruce McCardel, after the automated program determined he owed more than $6,700.