The Federal Government has agreed to bring a mentally ill young girl held on Nauru to Australia for medical treatment, after her lawyers took court action against the Minister for Immigration.

As an urgent hearing was due to get underway in Melbourne on Saturday morning, the Department of Immigration and Border Protection decided at 8:30am to fly the girl and her family to Australia as soon as possible.

The girl's lawyers say she has made three attempts at self-harm, the last as recently as two days ago, and she is under 24-hour surveillance by security guards on Nauru.

Maurice Blackburn lawyer Jennifer Kanis said outside court her client's condition was severe, and she should be in hospital.

"We're delighted that the Government has this morning agreed to bring our client from Nauru to Australia so that she can get the medical attention she so desperately needs," she said.

But Ms Kanis said the court action should never have been needed.

"It's outrageous that we need to take steps to bring matters before the court in order for the Government to take action that they should be taking, given they have a duty of care to children on Nauru," she said.

The girl cannot be identified, and her age and country of origin cannot be revealed, due to Federal Court orders.

A Government lawyer, Ashlee Briffa, told the court on Saturday morning that flights were being organised for the girl, and her father and sibling, to arrive in Australia late on Sunday.

"This has all happened very quickly," she told the court.

But Ms Kanis said outside court the Department of Immigration has had a medical report, describing the seriousness of her client's condition, for more than a week, and has failed to act on it.

"We don't know why the Government are saying they haven't been provided with that report," she said.

But Government lawyer Ashlee Briffa argued in court the Department had become aware of the medical report less than 24 hours ago.

The case will return to court next month.