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 spokesman told the BBC.
Details of the children's ages and the length of their detention have not been given.
The army has not made any comment.
Human rights groups argue that there is no proper legal process for civilians, including children, who are detained by the army as part of their 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," Manuel Fontaine, regional director for the UN Children's fund (Unicef) in Central and West Africa, told Reuters news agency.
Earlier this month, 21 of the more than 200 Chibok schoolgirls abducted by Boko Haram two years ago were released and reunited with their families.
Nigeria has been fighting a seven-year insurgency against Boko Haram, with the army retaking much of the territory under the Islamist militants' control in the past 20 months.
'Boko Haram took my children'
Town divided by Boko Haram legacy
On patrol against Boko Haram
Who are Boko Haram?
The UN says it has negotiated the release of 876 children in Nigeria, who were being held by the army over possible links to Islamist militants.