Armed groups in Central African Republic have agreed to release all the children that are working with them and end child recruitment, the UN says.
Militias are said to have recruited 6,000-10,000 children to work as soldiers, messengers or cooks.
The UN children's agency, Unicef, says it now needs to see the agreement put into practice.
Unicef says the CAR conflict "has created one of the world's worst - and least visible - humanitarian crises".
CAR has been wracked by violence since a mainly Muslim rebel group seized power in March 2013.
The Seleka group was then ousted, sparking a wave of violent reprisals against the Muslim population, thousands of whom fled their homes.
Government representatives, leaders of armed groups and UN agencies negotiated the deal during a week of talks in the CAR capital, Bangui.
Unicef chief in CAR Mohamed Malick Fall described it as "a major step forward for the protection of children".
But Unicef is cautious and wants immediate access to areas under the control of armed groups, and a strict timetable for the children's release, reports the BBC's Imogen Foulkes from Geneva, where Unicef is based.
Also the children will face a long rehabilitation, Unicef says.
A week-long national reconciliation forum began on Monday in Bangui bringing together politicians, armed groups, and religious leaders.
The talks are part of a process aimed at leading to new elections.