Their release yesterday came just days after President Omar al-Bashir declared in North Darfur that he would order all detained children from the rebel side be freed.
The child soldiers were captured in Darfur in 2015 during fighting between government troops and the rebel Justice and Equality Movement (JEM).
"The United Nations welcomes the release yesterday by the government of Sudan of 21 children associated with armed groups," the UN Children's Fund (UNICEF) said in a statement.
The released children will be housed in a government transit centre that will enable their re-integration into their families and communities, UNICEF said.
Also Read
On September 7, Bashir declared at a ceremony in the North Darfur state capital El Fasher that peace was returning to the war-torn region of five states.
At least 300,000 people have been killed in Darfur -- a region the size of France -- where ethnic minority groups took up arms in 2003 against Bashir's Arab-dominated government.
In August, talks in Addis Ababa between Khartoum and rebels on a ceasefire in Darfur and two other conflict zones failed, with an African Union mediating panel blaming insurgent groups JEM and Sudan Liberation Army-Minnawi.
It is unclear when fresh talks will start.
Disclaimer: No Business Standard Journalist was involved in creation of this content