Updated

Armed groups in Central African Republic freed more than 350 child soldiers Thursday in the largest such release since the country became engulfed in sectarian violence in late 2013, the U.N. children's agency said.

Three separate ceremonies took place near the town of Bambari, as children left the ranks of both a Christian militia and the Muslim rebel groups that once united to briefly rule the country.

Some of the children taken into the care of UNICEF were as young as 12, according to UNICEF Representative Mohamed Malick Fall.

"After two years of heavy fighting, the release of children by these groups -- on the same day -- is a real step toward peace," he said.

The armed groups had agreed to the mass release of children earlier this month in the capital of Bangui. Amid the meetings, rival factions also agreed to lay down their arms though similar attempts at a cease-fire and disarmament process have been derailed by infighting.

Social workers will try to reunite children with relatives "when security conditions permit," UNICEF said. Other children will stay with foster families until relatives can be found.

Tens of thousands fled Central African Republic to neighboring countries amid the violence, as Christian militias targeted Muslim civilians accused of having supported the brutal Muslim rebel regime. While the conflict was not religious in nature, it divided communities that had long lived together along sectarian lines.

Even after the mass release Thursday, UNICEF believes there are still more than 6,000 children among the fighters, including those being used as cooks and messengers. Girls and young women also have been forced into sexual relationships with rebels.