The Australian government and its contractors have offered compensation totalling A$70m (£41m, $53m) to refugees detained in Papua New Guinea.
The 1,905 claimants had alleged they suffered harm while being held on PNG’s Manus Island between 2012 and 2016.
The government said it “strongly denied” the allegations but that settling was a “prudent” decision.
Australia turns away any refugees and asylum seekers arriving by boat and sends them to PNG and Nauru.
The claim was due to be heard in the Victoria Supreme Court on Wednesday.
But shortly before the trial began, lawyers for the claimants said the government and its service providers had offered a last minute settlement of A$70m.
They also offered to cover costs estimated to be more than A$20m.
The full details of the settlement and the financial package are yet to be fully approved by the court.
Principal lawyer Andrew Baker said the settlement would “help [the claimants] put this dark chapter of their lives behind them”.
Australia’s immigration minister Peter Dutton said in a statement that the government “strongly refutes and denies the claims made in these proceedings”.
He added that if the case had gone to trial, it would have cost “tens of millions of dollars in legal fees alone, with an unknown outcome”, and the government decided a settlement was a “prudent outcome for Australian taxpayers”.
Australia has already said it plans to close the Manus Island centre but it remains unclear when that will happen.
It is also unclear what will happened to the remaining residents, but Australia has insisted that no-one held there will ever be re-settled in Australia.
As of last year, residents were allowed to freely come and go from the facility.
Australia says its policy on boat arrivals is intended to undermine the people-trafficking trade and prevent migrants from attempting the life-threatening journey to its shores.
But it has been heavily criticised both at home and internationally, including by the United Nations.