The heavily armed gunmen stormed Waga village in Adamawa state on Sunday and opened fire, Ahmed Soji said.
"The gunmen believed to be Boko Haram insurgents in trucks and on motorcycles attacked the village where they killed 20 people and burnt several houses," Soji said.
"The whereabouts of several other people are still unknown but it is assumed they fled into the bush to escape the attack and are yet to return," he said.
A second attack by the marauding gunmen on nearby Gublak village was repelled by soldiers in the area, Soji said without saying if there were casualties in the shootout.
Adamawa state, which is one of three states under emergency law along with Borno and Yobe, has seen a string of deadly Boko Haram attacks.
In February, the group killed 34 people and burnt scores of homes in coordinated bombing and shooting attacks on Michika, Kirchiga and Shuwa towns near the border with Borno state.
At least 24 people were killed on Sunday when Boko Haram gunmen raided Kumuta village in Borno State, where the Islamists have stepped up deadly attacks on villages in recent months.
According to residents, dozens of motorcycle-riding gunmen stormed the village after sunrise as locals were heading to the weekly market, opening fire on residents.
The militants, who have claimed the abduction of more than 200 girls from their school in Chibok, Borno state six weeks ago, have recently intensified their attacks in the states countryside, raiding villages where they kill residents, loot food supplies and set fire to homes.