SYDNEY (Reuters) – Australia’s High Court threw out a challenge to the country’s offshore immigration detention camps on Wednesday, clearing the way for the deportation of dozens of infants born in Australia to detained asylum seekers.

The court rejected a legal test case bought by an unidentified Bangladeshi woman that challenged Australia’s right to deport detained asylum seekers to the tiny South Pacific island nation of Nauru.

The Australian government said before the court ruling it planned to deport all of the roughly 250 asylum seekers detained in Australia back to Nauru.

The detention centre on Nauru houses about 500 people and has been widely criticised by the United Nations and human rights agencies for harsh conditions and reports of systemic child abuse.

The Bangladeshi woman was on a boat intercepted by Australian authorities in October 2013. She was detained on Christmas Island, a remote Australian territory in the Indian Ocean, and then later sent to Nauru.

She gave birth to a daughter after she was transferred to Australia for medical treatment in 2014 and has remained there with her child.

Other families with children born in Australia in similar circumstances are now in line to be returned to the detention camps.

Lawyers acting for the Bangladeshi woman had argued it was illegal for the Australian government to operate and pay for offshore detention in a third country.

Children born in Australia to non-citizens or parents without legal residency are not entitled to citizenship until after their 10th birthday, and then only if they have lived most of their lives in Australia, according to the Department of Immigration.

Under Australia’s controversial immigration policy, asylum seekers attempting to reach the country by boat are intercepted and sent to camps on Nauru, about 3,000 km (1,800 miles) northeast of Australia, or on Manus island in Papua New Guinea.

A similar test case challenging the legal status of Australia’s offshore processing operation in Papua New Guinea was rejected by the same court in June 2014.

The ruling will allow Immigration Minister Peter Dutton to fulfil his pledge to deport the infants, as well as 54 children brought to Australia from Nauru for medical treatment and more than 150 adult family members.

(Additional reporting by Matt Siegel; Editing by Jane Wardell and Paul Tait)