Gunmen killed at least 37 people in an attack on a camp for people displaced by violence in north central Nigeria, the second massacre in the area this week, local officials said on Saturday.
Friday's assault on a school housing displaced families in Benue State came after gunmen attacked a village in the same state earlier this week and killed as many as 50 people.
Motives for the attacks were not clear, but local officials have blamed ethnic Fulani nomadic herders who have long clashed with settled farmers in Benue over access to land and resources.
"My security advisor has confirmed to me that 37 people have been killed," Benue State Governor Samuel Ortom told AFP by telephone.
Security advisor Paul Hemba said the attack was on a primary school on the road to the state capital Makurdi used to house people displaced by inter-communal violence.
President Muhammadu Buhari, who leaves in May after two terms, on Saturday condemned the killings and said efforts were being made to end the "extreme violence".
"The president condemned the use of terrorism as a tool in intercommunal conflicts, urging that the attackers be found and dealt with swiftly under the law," the statement said.
Benue has been one of the states hit hardest by years of disputes between nomadic herders and pastoral farmers who blame herdsman for destroying farmland with their cattle grazing.
Those conflicts have often spiralled into broader criminality and tit-for-tat revenge attacks between informal armed militias established to protect rival communities.
A spokesman for the national herders association this week urged officials not to blame Fulani herders for every attack before carrying out proper investigations.
Ortom, a fierce critic of Buhari's security policies, is stepping down this year. But his opposition Peoples Democratic Party (PDP) lost the state governorship election in March to a candidate from Buhari's ruling All Progressives Congress (APC) party.
Insecurity will be a major challenge for incoming President-elect Bola Tinubu who won a February presidential election marked by technical delays and opposition accusations of vote rigging.
Nigeria's security forces are still battling to fully end a 14-year-old jihadist conflict in the northeast that has killed 40,000 people and displaced over two million more.
Northwest and central Nigeria are also struggling with heavily armed bandit gangs who raid villages and carry out mass abductions for ransom, part of an escalation of intercommunal disputes.