Gunmen have killed at least 17 people - mostly women and children - after invading a farming community in central Nigeria, drawing condemnation from Nigerian President Muhammadu Buhari.

Armed men on motorcycles and in a car carried out the attack in Zaki Biyam in Benue state on Monday, police spokesman Moses Yamu told AFP news agency on Tuesday.

Local media reported the death toll could be as high as 50, but Al Jazeera could not independently confirm that figure.

Yamu said the attackers opened fire on the victims and set buildings on fire in the latest violence linked to disputes over animal grazing rights.

READ MORE: Nigeria - Deadly nomad-versus-farmer conflict escalates

The assault comes barely a week after suspected Fulani herdsmen killed 10 people in the Buruku area of Benue state, which led Governor Samuel Ortom to order the herdsmen to leave the region within 72 hours.

President Buhari condemned the "loss of lives" in a statement issued on Tuesday.

"The president condemns the wicked attack and directs security agencies to begin immediate investigation with a view to bringing the perpetrators of the dastardly act to book," his office said.

An investigation is under way, police said.

"We have not made any arrests and we are yet to find out the motive for the attack. We have been given some names of people suspected of involvement in the attack and we are on their trail," Yamu said.

Such fights over land between the mostly Muslim herdsmen and mostly Christian farmers are common in Nigeria.

Ethnic tensions

The region has been wracked by a long-running conflict between nomadic Fulani herders and local farmers over grazing rights.

In July last year, state officials said scores of villagers were killed in Benue following weeks of clashes. Local television channels put the toll at 81.

In February 2016, hundreds of people were said to have been killed and about 1,000 homes destroyed in the Agatu area of the state in a wave of attacks blamed on the Fulani.

Buhari, a northern Muslim, has proposed the creation of grazing land to prevent further clashes in a country that is battling an eight-year Boko Haram insurgency in the northeast.

More than 300 people have been killed in clashes between Fulani herdsmen and Benue communities in the past two years.