The attack on Tuesday evening targeted the neighboring villages of Woro and Nuku, in Kwara state. A lawmaker who represents the area said that at least 162 people were killed, while Amnesty International said the gunmen killed over 170 people, razed homes and looted shops. The rights group deplored "a stunning security failure."
There has been a surge of deadly attacks and kidnappings by Islamic militants and armed gangs in Nigeria in recent months, as the country's overstretched military has struggled to contain an array of security challenges.
Here's what to know about the deadly attacks.
Nigeria is in the grip of a complex security crisis, including an insurgency by Islamic militants and a surge in kidnappings for ransom by criminal gangs.
For years, so-called "bandits" have mainly been active in northwestern Nigeria, but they have recently been moving to other parts of the country including Kwara state.
Islamic militants have also been increasingly active in Kwara as a decades-long insurgency, which until recently mostly affected northeastern Nigeria, has spilled over to western and central regions.
The most notorious are the homegrown jihadis Boko Haram, who took up arms in 2009 to fight Western education and impose their radical version of Islamic law. Boko Haram killed at least 36 people in northeastern Nigeria last week during separate attacks.
Other extremist armed groups in Nigeria also include at least two affiliated with the Islamic State: a Boko Haram offshoot known as the Islamic State West Africa Province, and the Islamic State Sahel Province, known locally as Lakurawa, which is mostly prominent in the northwest.
No group has claimed responsibility for the Tuesday attacks.
Mohammed Omar Bio, the area's representative in parliament, said the attacks were carried out by the Islamic State group-affiliated Lakurawa.
James Barnett, a researcher at the Washington-based Hudson Institute, said the attack was more likely perpetrated by the Jama'atu Ahlis Sunna Lidda'awati wal-Jihad, a Boko Haram faction that has been responsible for other recent massacres in the area.
Kwara State Gov. AbdulRahman AbdulRazaq said Tuesday's attack was likely carried out in response to recent counter-terrorism operations in the region.
AbdulRazaq said the attack was an attempt to distract security forces "who have successfully hunted down several terrorist and kidnapping gangs across many parts of the state."
The attacks came days after the United States took military action against armed groups in Nigeria.
On Tuesday, the head of U.S. Africa Command said the United States had sent a small team of military officers to Nigeria. Gen. Dagvin R.M. Anderson said the deployment came at Nigeria's request and was focused on intelligence support.
Nigeria has been in the diplomatic crosshairs of the U.S. in recent months following threats by U.S. President Donald Trump to attack the country, alleging it is not doing enough to protect its Christian citizens.
While Christians have been among those targeted, analysts say the majority of victims of armed groups are Muslims in Nigeria's Muslim-majority north, where most attacks occur.
But the diplomatic tensions have since been reworked into cooperation between the two countries. In December, U.S. forces launched airstrikes on IS-affiliated militants in Nigeria.
Last month, Nigeria's government said the U.S. has pledged to deliver outstanding military equipment purchased by the country over the past five years, including drones and helicopters. Some of the equipment was delayed in recent years over concerns about possible human rights abuses by Nigeria's security forces.
