MAIDUGURI, Nigeria — Villagers in northeastern Nigeria are fleeing their homes, leaving everything behind, after armed men on motorbikes roared into their area and gunned down funeral mourners on Saturday, killing at least 65 people, officials said on Monday.

Officials attributed the attack to Boko Haram, the Islamist extremist group that has terrorized the region for the last 10 years, although there was no immediate claim of responsibility for the assault.

The attack on Saturday, in the village of Badu Abachari, north of the city of Maiduguri, was in retaliation for an earlier clash, officials said.

Villagers have formed defense groups, armed with hunting guns and knives, to resist Boko Haram. People in the village that was attacked had repelled a militant assault two weeks earlier, said Mohammed Bulama, council chairman of the Nganzai area in Borno state. He said the villagers had killed 11 Boko Haram fighters and seized 10 AK-47 rifles.