NAIROBI, Kenya -- Somalia's government will work with the United Nations to release and rehabilitate child soldiers in its army, a U.N. envoy who tracks the recruitment of child soldiers said Wednesday.

The number of children in the Somali army is unclear, but a plan to be developed by the Somali government will help establish the extent of the problem, said Radhika Coomaraswamy, the U.N. special representative for children in armed conflict.

Human rights groups and media outlets have been reporting about the existence of child soldiers in Somalia for years. One Somali human rights group has estimated that thousands of child soldiers are used by both the weak, U.N.-backed government and Islamist militias like al-Shabab that have been trying to overthrow it for the past three years.

In June, President Sheik Sharif Sheik Ahmed ordered an investigation into the reports.

"There's been a rapid increase in the recruitment of child soldiers," Coomaraswamy told journalists in the Kenyan capital, Nairobi, after spending the day in Somalia where she met with Prime Minister Mohamed Abdullahi Mohamed and other officials.

She said the recruitment of child soldiers to all sides of the Somali conflict has risen in the past six to seven months and is done through radio broadcasts, in schools and elsewhere.

"They are exploited for the fact that children have a much less developed concept of death so they tend to be fearless," Coomaraswamy said.

In June, the U.N. Security Council approved a presidential statement urging the U.N.'s most powerful body to consider tough measures - including possible sanctions - against countries and insurgent groups that recruit child soldiers and violate international law on the rights and protection of children in armed conflicts.

In a recent report, U.N. Secretary-General Ban Ki-moon accused both Somalia's government and al-Shabab of trying to maim or kill children by putting them in the line of fire.

Somalia has not had a functioning government since clan-based warlords toppled dictator Mohamed Siad Barre in 1991 and then turned on each other, sinking the Horn of Africa nation into chaos.