Suspected Islamist militants killed 40 farmers in an attack on the Dumba community in Nigeria's northeastern Borno State on Sunday, a senior state official said on Monday.