When men wearing military fatigues and carrying weapons showed up in pickup trucks, villagers thought Nigerian soldiers had finally come to protect them from Boko Haram.

But it was a disguise. The gunmen rounded up everyone in the village centre and then started shooting.

Altogether, Boko Haram militants slaughtered hundreds of people in three villages in the far northeast corner of Nigeria, witnesses said, describing the latest attack by the Islamic extremist group that drew international attention for the kidnapping of more than 300 schoolgirls.

A community leader who witnessed the killings on Monday said residents had pleaded for the military to send soldiers to protect the area after they heard that militants were about to attack.

The militants arrived in Toyota Hilux pickup trucks - commonly used by the military - and told the civilians they were soldiers and that they had come ''to protect you all,'' the same tactic used by the group when they kidnapped the girls from a school in the town of Chibok on April 15.

''We all thought they were the soldiers whom we earlier reported to that the insurgents might attack us,'' said the community leader, who spoke on condition of anonymity because he feared for his life. After the militants forced everyone into the village centres, ''they began to shout 'Allahu akbar, Allahu akbar,' then they started to fire at the people continuously for a very long time until all who had gathered were dead,'' he said. Allahu akbar means God is great.

The killings took place in the villages of Danjara, Agapalwa, and Antagara, part of Gwoza district in Borno state. The community leader said he fled to Maiduguri, the Borno state capital, adding that some who escaped the massacre crossed into the neighbouring country of Cameroon while others remain trapped in the mountainous region.

''They still see the gunmen going about attacking villages and hamlets by setting them on fire,'' he said.

He said managed to survive because ''I was going around to inform people that the soldiers had come and they wanted to address us.'' As people were fleeing, other gunmen lurked outside the villages on motorcycles and mowed them down.

The slaughter was confirmed by Mohammed Ali Ndume, a senator representing Borno whose hometown is Gwoza, and by a top security official in Maiduguri who insisted on anonymity because he isn't allowed to speak to the media.

It took a few days for survivors to get word of the massacres to Maiduguri because travel on the roads is extremely dangerous and phone connections are poor or nonexistent.

In another incident, gunmen killed 45 people in Bargari village on Wednesday after gathering them in front of the village mosque, a witness said.

''We were scared because we knew that they were Boko Haram members,'' said Abuwar Yale, a witness who escaped the attack.

The gunmen who arrived at 9pm told the people they were there to preach Islam and not kill and then asked them to go to the village mosque. As soon as the men gathered there, the militants opened fire chanting ''Allahu akbar''.

Yale and the others who escaped hid in the bush the whole night and returned to the village in the morning. The houses in the village were set ablaze and the livestock was stolen, he said.

In Borno state, militants attacked Alagarno, a village near Chibok where the girls were kidnapped, and destroyed it, according to Pogu Bitrus, a Chibok community. People heard gunshots as the fighters were approaching and were able to flee, he said.

Ndume said the military has assured the Borno state governor that it will dispatch soldiers immediately.

''It is sad that we have to wait until now that people are being killed for government to take action,'' he said. ''Soldiers of the Nigerian army have been overstretched in both human and material capacity.''

Nigeria's military has insisted that a big influx of troops and a year-old state of emergency in Borno and two other states have the insurgents on the run. But soldiers have told the AP that they are outgunned and outnumbered by the insurgents, don't have bullet-proof vests, are not properly paid and have to forage for food.

Boko Haram, which wants to establish Islamic state in Nigeria, has been taking over villages in the northeast, killing and terrorising civilians and political leaders. Thousands of people have been killed in the five-year-old insurgency, more than 2000 so far just this year, and an estimated 750,000 Nigerians have been driven from their homes.

The Gwoza district, where Monday's attack took place, is a regional political center whose emir was killed last week in a Boko Haram ambush on his convoy. Emirs are religious and traditional rulers who have been targeted for speaking out against Boko Haram's extremism.

Borno Governor Kashim Shettima travelled on Saturday to Gwoza to pay his respects to the slain emir and was quoted in a local media report as saying it was a terrifying 135 kilometre ride. A Nigerian journalist in the convoy escorted by 150 soldiers counted at least 16 deserted towns and villages along the way.

In London, British officials announced that they will host a meeting on June 12 to discuss how to improve regional coordination in tackling Boko Haram and terrorism. The session will be attended by Nigerian Foreign Minister Aminu Bashir Wali as well as envoys from Nigeria's neighbours Benin, Chad, Cameroon and Niger, plus the U.S., France, Canada and the European Union.