The government said that the settlement was not an admission of liability and that it strongly rejected the plaintiffs’ claims. “An anticipated six-month legal battle for this case would have cost tens of millions of dollars in legal fees alone, with an unknown outcome,” the Department of Immigration and Border Protection said in a statement. “In such circumstances a settlement was considered a prudent outcome for Australian taxpayers.”

Since 2012, Australia has confined thousands of asylum seekers, intercepted at sea while trying to reach Australia, in offshore detention camps on Manus and the Pacific island nation of Nauru. The government says the policy is meant to deter human traffickers from sending desperate people to Australia on rickety boats, usually by way of Indonesia.

Human rights groups and the United Nations have condemned the policy, under which refugees have languished for years in grim conditions. A United Nations report said that 88 percent of detainees on Manus examined by medical experts last year had depressive disorders.

The case had been set to go to trial on Wednesday, Mr. Baker said in an interview.