Forty-five people were killed by suspected Boko Haram gunmen pretending to be preachers in a village near the group's spiritual home in northeast Nigeria, two residents said on Thursday.

The attack happened at about 9.30pm on Wednesday in Barderi, on the outskirts of Maiduguri, and saw insurgents hoodwink locals into congregating before opening fire on the crowd.

Hundreds of people are feared dead after suspected Boko Haram attacks on four villages in northeast Nigeria on Tuesday, a local lawmaker and residents have said.

Some community leaders put the death toll for those attacks in the Gwoza district of Borno state as high as 400 to 500 but there has been no independent confirmation because of poor communications in the area.

Lawmaker Peter Biye told AFP: "The killings are massive but nobody can give a toll for now because nobody has been able to go to that place because the insurgents are still there. They have taken over the whole area."