The Australian government has agreed to move a seriously ill refugee girl from Nauru to Australia within days. She is at least the seventh child to be moved from offshore islands after legal action on their behalf.

The young girl, who has been held on Nauru with her parents for several years and whose name and age cannot be reported, is suffering from acute mental health issues.

The National Justice Project brought an urgent interlocutory hearing in the federal court on Wednesday afternoon seeking orders to bring the girl and her family immediately to Australia.

Just prior to the hearing before Justice Tom Thawley, the government agreed to move the girl. The court heard the girl and her mother would be brought to Australia for medical treatment “on or about Friday of this week”.

Australian courts have consistently found that healthcare on Nauru is inadequate, particularly for children suffering mental health issues, and that Australia has a duty of care to protect and treat them.

In at least three cases in the past seven months, Australian judges have ordered that young children be immediately brought to Australia for care.

The latest hearing was on Tuesday this week, when a two-year-old girl who had suffered encephalitis was ordered to Australia after first having been taken from Nauru to Papua New Guinea in defiance of the orders of doctors – who recommended she be transferred to Australia – and despite the Port Moresby hospital to which she was sent saying they did not have the equipment to adequately treat her.

The two-year-old girl has been moved to Australia.

In another case, a 10-year-old boy had attempted suicide three times on Nauru, and doctors said he was at critical risk of killing himself.

Lawyers sought his transfer to Australia for urgent medical intervention but this was resisted by the Australian government, which asked for the court hearing to be delayed a week, arguing the boy could be adequately cared for on Nauru.

Justice Nye Perram disagreed, saying there was a “significant risk the boy would not be alive by that hearing” and ordered the boy be brought immediately to Australia for care, where he remains.

In other cases, the government has agreed just before court proceedings commence to move children to Australia for healthcare.

George Newhouse, the principal solicitor with the National Justice Project, who has run the majority of cases, said many refugee and asylum seeker families had been on Nauru for nearly five years, “and their health is rapidly deteriorating, particularly the children’s mental health”.

“Their lives are hopeless and they live in complete despair,” he said. “It’s getting worse. We are alarmed at the number of children who are at imminent risk of harm or death.”

Newhouse said the medical evidence showed clearly that medical care on Nauru for refugee and asylum seeker children was dangerously inadequate.

“Children’s lives are at risk on Nauru and it is just a matter of time before one dies or is seriously harmed. If that happens, Australia is responsible. The government needs to take this situation seriously and do something to get these families off Nauru to somewhere safe.”