The United Nations has negotiated the release of nearly 900 children held by the Nigerian security forces in the northeast of the country.
A representative from the UN Children's Fund said they were held on suspicion they could be linked to the Islamist group, Boko Haram.
The children, who had previously lived in areas controlled by Boko Haram, were held in a military barracks in the north-eastern city of Maiduguri, a UN spokesperson said.
Details of the their ages and how long they were held have not been given.
The army has not made any comment.
Human rights groups argue there is no proper legal process for civilians detained by the army as part of its counter-insurgency operations.
"We fear that there are still kids who are being at least temporarily detained because they are being released from Boko Haram areas by the army but then kept for a while," said regional director for Unicef Manuel Fontaine.
Earlier this month, 21 of the 219 Chibok schoolgirls abducted by Boko Haram two years ago were released and reunited with their families.
Who are Boko Haram?
Nigeria has been fighting a seven-year insurgency against Boko Haram.
Founded in 2002, the group initially focused on opposing Western-style education - Boko Haram means "Western education is forbidden" in the Hausa language.
It launched military operations in 2009 and has since killed thousands and abducted hundreds, including the hundreds of schoolgirls.
Boko Haram has joined Islamic State, and now calls itself IS's "West African province", declaring a caliphate in the large part of north-east Nigeria it seized.
In the past 20 months the army has taken back much of the territory in the northeast of Nigeria that was formerly under the group's control.