The Australian government has offered compensation totalling A$70m (US$53m) to refugees detained in Papua New Guinea.

The Australian government has agreed to pay detainees on Manus Island more than $70 million (US$53 million) in the “largest settlement in a human rights class-action” in the country’s history.

The payment is part of a legal settlement reached on Wednesday in a case taken by human rights’ lawyers on behalf of the detainees, who sought to reach Australia by boat to apply for refugee protection but were instead transferred to remote South Pacific Islands.

Canberra has agreed to pay compensation to avoid the publicity and cost that would be generated by a trial but has denied liability, in what lawyers say is one of the largest human rights-related class action settlements in Australia to date.

“This settlement is an important step towards recognising the extremely hostile conditions that detainees endured at Manus Island,” said Andrew Baker, lawyer at Slater & Gordon, who represented current and former detainees.

More than 1,900 detainees had alleged they suffered serious physical and psychological injuries during their time in the Australian government’s offshore asylum seeker detention center on the Papua New Guinea island, between 2012 and 2016.

“While no amount of money could fully recognize the terrible conditions the detainees endured, we hope today’s settlement can begin to provide them with an opportunity to help put this dark chapter of their lives behind them,” the plaintiffs’ lawyer Andrew Baker said, adding that the settlement reflected the “unquestionable importance of access to justice.”

The more pressing problem is what to do with the hundreds of refugees who remain on Manus Island and Nauru.

The detention center, which houses almost 900 men, was ruled “illegal and unconstitutional” by the Papua New Guinea Supreme Court in April 2016 but remains operational.

Its closure is slated for October. Australia refuses to resettle asylum seekers who arrive by boat and pays the impoverished Pacific island nationals of Papua New Guinea and Nauru to keep hundreds of them from the Middle East, Africa and Asia.

The US is considering resettling up to 1,250 refugees from Manus Island and Nauru under a deal struck between Australia and President Barack Obama’s administration.

Those considered for resettlement, however, will subjected to the “extreme vetting” policies of the US.