Boko Haram Islamist have released 21 of more than 200 girls kidnapped in 2014 in the northern town of Chibok.
“The release of the girls . . . is the outcome of negotiations between the administration and the Boko Haram brokered by the International Red Cross and the Swiss government,” a Nigerian presidency statement said. “The negotiations will continue.”
Around 270 girls were taken from their school in Chibok in April 2014. Dozens escaped in the initial melee, but more than 200 are still missing.
The kidnapping triggered worldwide outrage promoted by a Twitter hashtag #bringbackourgirls.
The presidency gave no details on the deal, saying only that the 21 girls were very tired and would first rest in the custody of the national security agency.
Afterwards the girls would be handed over to Vice President Yemi Obinsajo, the statement said. President Muhammadu Buhari will travel to Germany on Thursday.
Authorities said in May that one of the missing girls had been found, and Mr Buhari vowed to rescue the others.
Boko Haram’s seven-year insurgency to create an Islamic state in the northeast has led to the deaths of 15,000 people and displaced more than two million.
The Nigerian military has been carrying out a large-scale offensive in the Sambisa forest, Boko Haram’s stronghold, in the last few days.
The jihadist group, which last year pledged loyalty to the militant group Islamic State, controlled a swathe of land around the size of Belgium at the start of 2015.
But under Nigeria's army, aided by troops from neighbouring countries, has recaptured most of the territory that had been lost. The group still stages suicide bombings in the northeast, as well as in neighbouring Niger and Cameroon.
Boko Haram published a video in August apparently showing recent footage of dozens of the girls. In the video they said some of the girls were killed in air strikes.
Boko Haram has kidnapped hundreds of men, women and children, but the kidnapping of the Chibok girls brought worldwide attention to the group.
In the last few months Buhari has said his government was prepared to negotiate with Boko Haram over the release of the girls.