“The girls were released through negotiations with the government,” one official said, asking not to be named, adding that an official statement would follow shortly.

A military source said the girls were currently in Banki near the Cameroon border for medical checks before being airlifted to Maiduguri, the capital of Borno state.

The kidnapping was one of the high-profile incidents of Boko Haram’s insurgency in Nigeria’s northeast, now in its eighth year and with little sign of ending. About 220 were abducted from their school in a nighttime attack.

More than 20 girls were released last October in a deal brokered by the International Committee of the Red Cross. Others have escaped or been rescued, but 195 were believed to be still in captivity before this release.

Nigerian President Muhammadu Buhari said last month that the government was in talks to secure the release of the remaining captives.

Although the Chibok girls are the most high-profile case, Boko Haram has kidnapped thousands of adults and children, many of whose cases have been neglected.

The militants have killed more than 20,000 people and displaced more than 2 million during their insurgency aimed at creating an Islamic caliphate in northeast Nigeria.

Although the army has retaken much of the territory initially lost to Boko Haram, large parts of the northeast, particularly in Borno state, remain under threat from the militants. Suicide bombings and gun attacks have increased in the region since the end of the rainy season late last year.

(Reporting by Felix Onuah, Tife Owolabi, Ahmed Kingimi and Ulf Laessing; Editing by Angus MacSwan, Hugh Lawson and Jonathan Oatis)