Nigeria said on Friday it had agreed a ceasefire with Islamist militants Boko Haram and reached a deal for the release of more than 200 schoolgirls kidnapped by the group six months ago.

There was no immediate confirmation from the rebels, who have wreaked five years of havoc in Africa's top oil producer and triggered an international outcry by seizing the girls from the northeast town of Chibok in April.

"I wish to inform this audience that a ceasefire agreement has been concluded," said the head of Nigeria's military, Air Chief Marshal Alex Badeh, adding the deal had followed three days of talks with the militant sect.

Government spokesman Mike Omeri said the deal covered the release of the captives and Boko Haram had given assurances "that the schoolgirls and all other people in their captivity are all alive and well".

Their release would be a huge boost for President Goodluck Jonathan, who faces an election next year and has been pilloried at home and abroad for his slow response to the kidnapping and his inability to quell the violence, the biggest security threat to Africa's biggest economy.

Apart from one appearance on a Boko Haram video, the girls have not been seen since the brazen night-time raid on the town near the Cameroon border, although police and a parent said last month that one of the victims had been released.

Boko Haram, whose name roughly translates as 'Western education is sinful', has killed thousands of people in its fight to create an Islamic caliphate in the vast scrubland of Nigeria's impoverished northeast.

A senior Nigerian security source confirmed the existence of talks, but said it remained unclear whether Abuja was negotiating with self-proclaimed movement leader Abubakar Shekau, or another faction within the group.

"Commitment among parts of Boko Haram and the military does appear to be genuine. It is worth taking seriously," the security source told Reuters.

Several rounds of negotiations have been attempted in recent years but they have never achieved a peace deal, partly because the group is believed to be deeply divided.

"There are some talks but it depends on the buy-in of the whole group. I would be surprised if Shekau had suddenly changed his mind and is ready for a ceasefire," the source added.

The government was negotiating with Danladi Ahmadu, a man calling himself the secretary-general of Boko Haram, a presidency source said. It was not clear if Ahmadu is part of the same faction as Shekau.

Security sources in neighbouring Chad said Chadian mediators had been involved in the discussions, which were part of a larger deal that led to the release a week ago of 27 hostages, including 10 Chinese workers, kidnapped in Cameroon.

Separately, Cameroon's defence ministry said eight soldiers and 107 Boko Haram militants had been killed in fighting in the far north on Wednesday and Thursday, a region that has suffered regular cross-border raids.