Niger’s defence ministry said four military personnel were injured and 20 attackers killed in the incident.