A British official says Nigeria's government is ruling out the possibility of releasing jailed militants in exchange for more than 270 schoolgirls who are being held captive by an Islamic extremist group.

Mark Simmonds, Britain's top official for Africa, told journalists in the Nigerian capital, Abuja, on Wednesday that President Goodluck Jonathan had "made it very clear that there will be no negotiation with Boko Haram that involves a swap of abducted schoolgirls for prisoners."

Simmonds spoke after a meeting with Jonathan.

But Nigeria's government will talk to the militants on reconciliation, Simmonds said, talking about his discussion with Jonathan.

Nigerian troops fire at superior

Soldiers say angry Nigerian troops fired at a senior officer in another sign of a demoralized military supposed to be leading the hunt for nearly 300 schoolgirls kidnapped by Islamic extremists.

They say the soldiers fired Wednesday on a vehicle carrying Maj. Gen. Ahmadu Mohammed after 14 soldiers were killed in an ambush. The slain soldiers were in a group that had told their command the road was dangerous and wanted to spend the night in a village. They were ordered to travel instead.

Mohammed was not hurt. 

"The point that also was made very clear to me is that the president was keen to continue and facilitate ongoing dialogue to find a structure and architecture of delivering lasting solution to the conflict and the cause of conflict in northern Nigeria," Simmonds said.

Boko Haram abducted more than 300 schoolgirls from a school in Chibok in the northeastern state of Borno on April 15. At least 276 of those girls are still being held captive by militants who have threatened to sell them into slavery, sparking outrage at home and abroad over the government's apparent failure to rescue then.

In a video released on Monday, Boko Haram's leader says he will free the girls only if the government releases jailed members of his group. The footage was verified as authentic by Nigerian authorities, who said 54 of the girls had been identified by relatives, teachers and classmates who watched the video late Tuesday.

Nigerian government officials have given conflicting responses to Boko Haram's offer of a swap.

One senior official said on Tuesday that "all options" are now open — including negotiations or a possible military operation with foreign help — in efforts find the missing girls.

NIGERIA-GIRLS/

Protesters gather in Lagos, Nigeria. In the village of Kalabalge, residents said they were taking matters into their own hands because the Nigerian military is not doing enough to stem Boko Haram attacks. (Akintunde Akinleye/Reuters)

It was not immediately possible to confirm Simmonds's comments with Nigerian officials.

Britain and the U.S. are actively helping Nigeria's government to find and rescue the girls.

The British government has said a team of security experts sent to Nigeria will consider "not just the recent incidents but also longer-term counter-terrorism solutions to prevent such attacks in the future and defeat Boko Haram."

Boko Haram has killed more than 1,500 people this year in a campaign of bombings, massacres and mass kidnappings.

Nigeria vigilantes kill scores of Islamic militants

Meanwhile, villagers in an area of Nigeria where Boko Haram operates have killed and detained scores of the extremist Islamic militants who were suspected of planning a fresh attack, the residents and a security official said.

In Kalabalge, a village about 250 kilometres from the Borno state capital of Maiduguri, residents said they were taking matters into their own hands because the Nigerian military is not doing enough to stem Boko Haram attacks.

On Tuesday morning, after learning about an impending attack by militants, locals ambushed two trucks with gunmen, a security official told The Associated Press. At least 10 militants were detained, and scores were killed, the official said, speaking on condition of anonymity because he is not authorized to give interviews to journalists. It was not immediately clear where the detainees were being held.

Kalabalge trader Ajid Musa said that after residents organized the vigilante group, "it is impossible" for militants to successfully stage attacks there.