The East African country of Somalia recently concluded a 60-day amnesty program for anyone willing to defect from the Islamist terrorist group, al-Shabab.

It is too soon to judge how effective this amnesty program will be in the long term. However, its inducement of a significant number of terrorist defections at least temporarily boosts the fight against al-Shabab, and demonstrates the range of motivations of people who join the group.

The amnesty declared by the Somali government on April 6 was the second one it had offered since 2014. To take advantage of the amnesty, defectors had to renounce their membership with al-Shabab, reject Islamist terrorism, and work to improve the country.

Defectors participate in a rehabilitation program, known as the Disengaged Combatants Programme, that give job training, reading and writing instruction, and psychological support services. The program concludes with a final interview.

If the “exit board” conducting the final interview concludes that the defector is fully disengaged from terrorism and no longer poses a threat, it allows him to re-enter Somali society. Graduates are safe from terrorism prosecution, and they can rejoin their families and obtain employment.

Oftentimes, graduates are encouraged to work in the National Intelligence and Security Agency and to aid officials there in their efforts to induce additional defections. However, former al-Shabab leaders and those who committed particularly heinous human rights abuses are handled differently.

The amnesty is a component of newly elected President Mohamed Abdullahi Mohamed’s effort to annihilate al-Shabab, a goal shared by the U.S. government. The terrorist group has bedeviled Somalia for a decade, and once controlled as much as one-third of the country.

A multinational coalition has since driven al-Shabab from many of its strongholds, but the group is still dangerous. Last year, it killed almost four times the number of people it killed in 2015.

The group recently vowed to escalate its violent campaign and carried out “one of its deadliest attacks in years” on June 8, killing an estimated 70 people in an attack on a Somali military base. Al-Shabab also threatens Somalia’s neighbors, many of whom are U.S. allies.

Amnesty is not a silver bullet against such a dangerous terrorist organization, but it could drain fighting power from the group.

Some people joined al-Shabab for practical reasons: for money, because of clan politics, or out of a desire to exact or escape revenge. Others were kidnapped and forced to fight, or duped into joining the group.

These “pragmatic” members of al-Shabab are the best candidates for defection, as they are not fanatically committed to the jihadist cause. An amnesty program can be a useful way to remove them from the battlefield.

However, there are some obvious pitfalls and limitations to amnesty programs.

Terrorists could pose as defectors to give them an opportunity to strike later when they have the advantage of being considered safe. The Somali government has to determine which crimes are so heinous that they cannot be pardoned, even if the offender defects.

Furthermore, those who embraced al-Shabab’s violent ideology will almost certainly never defect. Al-Shabab’s leadership, and undoubtedly fighters at every level of its ranks, are committed to a violent interpretation of Islam they believe compels them to fight.

So too with foreign fighters who traveled far from their usual place of residence to fight, as ideology almost exclusively motivates such terrorists.

Finally, even those who joined for pragmatic reasons might also become fanatics, either because of al-Shabab’s intensive indoctrination program for recruits, or because of the hardening effects of witnessing and partaking in violent acts.

The longer a recruit is with al-Shabab, the more cautious authorities must be of him.

Despite the challenges, it is worth monitoring Somalia’s experience with its amnesty program to see how effective it can be. If the government can accomplish it safely, foot soldiers removing themselves from the battlefield has obvious appeal in the fight against terrorism.