The government failure to secure the schoolgirls' release has sparked mass protests
Nigeria's military says it has agreed a truce with Islamist militant group Boko Haram - and says the schoolgirls the group has abducted will be released.
Boko Haram sparked global outrage six months ago by abducting more than 200 schoolgirls.
Nigeria's chief of defence staff, Alex Badeh, announced the truce. Boko Haram has not made a public statement.
The military has struggled to defeat Boko Haram, an Islamist group that has fought an insurgency since 2009.
The girls were seized in the north-eastern town of Chibok, and their continued captivity has led to criticism of the Nigerian government's efforts to secure their release.
Air Chief Marshal Badeh revealed the truce at the close of a three-day security meeting between Nigeria and Cameroon. He said Nigerian soldiers would comply with the agreement.
Nigerian presidential aide Hassan Tukur told BBC Focus on Africa that the agreement was sealed after a month of negotiations, mediated by Chad.
As part of the talks, a government delegation twice met representatives of the Islamist group.
Boko Haram militants control several towns and villages in northern Nigeria
Mr Tukur said Boko Haram had announced a unilateral ceasefire on Thursday and the government had responded.
"They've assured us they have the girls and they will release them," he said.
"I am cautiously optimistic."
He said arrangements for their release would be finalised at another meeting next week in Chad's capital, Ndjamena.
The negotiations are said to have the blessing of Boko Haram leader Abubakar Shekau, reports the BBC's Chris Ewokor in Abuja.
Who are Boko Haram?
Boko Haram leader Abubakar Shekau is the most wanted man in Nigeria