ABUJA (Reuters) - A regional militia allied with Nigerian government forces freed on Friday almost 900 children it had used in the war against Islamist Boko Haram insurgents, the United Nations Children’s Fund (UNICEF) said.

The move brought the total number of children freed to more than 1,700, a UNICEF statement said. Non-state armed groups embroiled in the decade-long conflict against Boko Haram recruited more than 3,500 children between 2013 and 2017 in Nigeria’s northeast, according to UNICEF.

“(This) is a step in the right direction for the protection of children’s rights and must be recognized and encouraged,” UNICEF Nigeria chief Mohamed Fall said in the statement, referring to Friday’s release by the militia group, which works closely with the military to fight Boko Haram.

“Children of northeast Nigeria have borne the brunt of this conflict. They have been used by armed groups in combatant and non-combatant roles and witnessed death, killing and violence.”

The militia group had committed in September 2017 to ending their use of children in the conflict. Last October, 833 were released by the group.

It is not clear how many children in total have been drawn into Nigerian armed groups, including Boko Haram, or how they have been recruited. Videos seen by Reuters show child soldiers rescued from Boko Haram demonstrating to Nigerian troops how they were trained to fight and shoot rifles.

Nigeria’s war against two jihadist groups, Boko Haram and Islamic State West Africa Province, has left more than 30,000 people dead and displaced millions more, with the Islamist insurgencies showing little sign of ending.

Residents of northeast Nigeria formed the militia, called the Civilian Joint Task Force, to help take on Boko Haram, which arose from the same communities. Some credit the militia with making early headway against Boko Haram in urban areas, using its local knowledge to identify people affiliated with the militants, although also drawing allegations that it sometimes used its power to settle scores in localized feuds.

UNICEF’s work in northeast Nigeria has at time angered authorities. In December, the military briefly suspended the agency’s work amid allegations that UNICEF staff spied on behalf of militants in the restive region.

The northeast of Nigeria, Africa’s most populous country and biggest energy producer, is rife with abuses on both sides of the conflict - from the recruitment of children to extrajudicial killings and rapes, according to human rights groups.