Attempts to coax members of Nigeria's Boko Haram away from jihadism and return to society have been gathering pace since the group's chief, Abubakar Shekau, was killed earlier this year.
Boko Haram's 12-year-old insurgency has devastated northeastern Nigeria, with massacres and suicide bombings spilling over into neighbouring Chad, Niger and Cameroon.
The campaign has left around 40,000 dead and two million displaced and spawned a splinter group affiliated with the Islamic State group, the Islamic State West Africa Province or ISWAP.
Boko Haram aims to create a hardline Islamic state in Nigeria.
The group's name is Jama'tu Ahlis Sunna Lidda'awati wal-Jihad (JAS) but it is commonly called Boko Haram, which loosely translates from the Hausa language as "Western education is forbidden".
It was founded in 2002 in Maiduguri, Borno state, by radical preacher Mohammed Yusuf, who blamed Nigeria's ills on Western values left by former colonial ruler Britain.
He also accused the country's secular leaders of corruption and neglecting northern Muslim regions.
Yusuf built a following among disaffected youths.
He was killed in police custody in July 2009 after an uprising in Maiduguri that prompted a fierce military assault.
Some 800 people died in the action, and Boko Haram's mosque and headquarters were left in ruins.
Many of its supporters fled the country.
Descent into killing
After Yusuf died his successor, Abubakar Shekau, undertook a violent campaign of deadly attacks on schools, churches, mosques and state security forces.
Some Boko Haram members are thought to have trained with Al-Qaeda in the Islamic Maghreb (AQIM) in northern Mali in 2012 and 2013.
Among the group's most notorious acts was the April 2014 kidnapping of 276 schoolgirls from the remote town of Chibok.
The mass abduction brought Boko Haram worldwide notoriety and came as it was turning large swathes of the northeast into a no-go area.
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.
The violence sparked a humanitarian crisis and acute food shortages in the mainly rural northeast.
An offensive since 2015 by Nigerian troops backed by soldiers from Cameroon, Chad and Niger drove jihadists from most of the area.
Nigerian President Muhammadu Buhari declared in December 2015 that Boko Haram was "technically" defeated.
But the group and its dissident offshoot ISWAP still stage deadly attacks on both military targets and civilians.
Mass trials of suspects started in October 2017 but most were released due to lack of evidence, with some 100 locked up.
Split and resurgence
Boko Haram splintered into two rival factions in 2016 over disagreements about Shekau's indiscriminate targeting of Muslim civilians and use of children and women as suicide bombers.
The ISWAP faction originally established by Muhammad Yusuf's son Abu Mus'ab al-Barnawi now has the backing of the Islamic State group over Shekau's fighters.
ISWAP is particularly active on the Chad and Niger borders and has since July 2018 carried out numerous attacks on military bases.
The group is also behind the abduction and killing of Christians and aid workers.
Shekau's faction continued to stage suicide bombings targeting civilians, but came under pressure from the military that bombed its camps and hideouts.
In 2019, a group of fighters known as "Bakura" operating in the Lake Chad area pledged allegiance to Shekau.
In December 2020, Boko Haram claimed to have been responsible for abducting hundreds of young boys from a school in Kankara in the northwest, far from its Sambisa forest base. They were released after a week.
Death of Shekau
In June 2021, ISWAP claimed Shekau had killed himself to evade capture after he was surrounded by ISWAP fighters in his Sambisa forest hideout following infighting between the factions.
Boko Haram loyalists confirmed his death later in June. Security sources say ISWAP commanders have since moved to consolidate their control in some of Boko Haram's strongholds in the northeast, though some Shekau loyalists are still holding out.