Nigeria’s Boko Haram started as an Islamic anti-corruption group that became a violent, IS-affiliated movement whose insurgency has threatened stability in the Lake Chad region.
But the Nigerian authorities say they are now rolling back the group and thousands of suspected members of the group were due to go on trial from Monday.
Boko Haram, whose name loosely translates from the Hausa language as “Western education is forbidden”, aims to create a hardline Islamic state in northeast Nigeria.
Its revolt has cost at least 20,000 lives since 2009.
Mohammed Yusuf, the group’s founder, blamed Western values left by Nigeria’s British former for the country’s ills and advocated a return to more fundamentalist Islam.
He attracted many disaffected youths in Maiduguri, capital of Borno state, with criticism of a corrupt secular regime that neglected development in the mainly Muslim region.
Boko Haram was broadly peaceful before Yusuf was killed in custody in 2009 after an uprising in Maiduguri, which prompted a military assault which killed some 700 and left the group’s mosque and headquarters in ruins.
Abubakar Shekau, Yusuf’s right-hand man, replaced him as leader, going on to wage dozens of deadly attacks on schools, churches, mosques, state entities and security forces.
Some Boko Haram members are thought to have trained with Al-Qaeda in the Islamic Maghreb in northern Mali in 2012 and 2013. Washington has said the two groups have ties.
Among the group’s most notorious acts was the April 2014 kidnapping of more than 200 schoolgirls from the remote town of Chibok.
A total of 106 have since been released, found or escaped: 113 remain captive.
The mass abduction brought world attention to the insurgency at a time when Boko Haram was seizing territory across the northeast, threatening Nigerian sovereignty.
In August 2014, Shekau proclaimed a “caliphate” in the Borno town of Gwoza and in March 2015 pledged allegiance to the Islamic State group in Iraq and Syria.
Muhammadu Buhari, who took office as elected president in May 2015, made crushing the group one of his top priorities and transferred the command centre from Abuja to Maiduguri.
The Nigerian military has since claimed to have reduced Boko Haram to a spent and divided force. But bloody raids and suicide bomb attacks continue.
Eight years of violence have forced 2.6 million from their homes, destroying property and farmland in the mainly rural northeast, sparking a humanitarian crisis and acute food shortages.
Hundreds of thousands of people have lived under the threat of famine and are dependent on aid agencies for food, water, shelter and healthcare.