It was the sort of scene that has become ubiquitous across the Middle East. A small convoy of vehicles, packed with armed men, approach a rickety checkpoint manned by another group of armed men. The cars refuse to stop, a shot is fired, and a gun battle ensues.

That is exactly what happened a few weeks ago in Yemen. Only this time, the men in the vehicles were members of al-Qaeda in the Arabian Peninsula (AQAP) and the checkpoint was manned by ISIS. That battle and a second, longer one that followed a day later marked the first time in more than four years that the two groups in Yemen have come into direct conflict with one another. It is also another in a growing list of indicators suggesting that, like much of the country, Yemen’s jihadi world is breaking apart.

AQAP is weaker now than it has been at any point since it was formed in 2009. ISIS, which enjoyed a brief moment of ascendancy in Yemen, is down to a few training camps and a dwindling number of fighters.

That is good, if fairly surprising news. After all, wars are supposed to be good for terrorists, the messier the better. And Yemen’s war has been among the world’s ugliest: large numbers of civilian casualties, cholera outbreaks, proxy forces, assassinations, torture, starvation and allegations of state-sanctioned sexual abuse.

Initially at least, things played out as expected. AQAP took advantage of the collapse of the central government in early 2015 to seize al-Mukalla, the country’s fifth largest city, which they ruled for a year, pocketing millions of dollars in the process. But in April 2016, ahead of a joint Yemeni-UAE offensive, AQAP withdrew from the city instead of staying behind to fight. (A recent investigation by the Associated Press suggests that AQAP withdrew as part of a deal with the UAE.)  

That same year, the Obama administration’s last, the US carried out more than 30 drone strikes on suspected AQAP targets. The next year, under the Trump administration the number of strikes would more than quadruple to over 130. But it is more than just the drone strikes, as devastating as those have been, that has brought AQAP and ISIS to their lowest point in years. It has been the war itself.

Yemen is too chaotic, too confusing, and has too many battlefronts for even groups like AQAP and ISIS to manage. They are fighting all sides in this war: the Houthis, the Yemeni government, the Saudis, the UAE, the US and, as of a few weeks ago, each other. What this means in practice is that both AQAP and ISIS are fighting multiple wars at once. And they are paying a price. What happens in one part of the country against one particular enemy does not necessarily reflect what is happening in another part of the country against another enemy.

With electronic communications increasingly dangerous – AQAP has released multiple public service announcements, jihadi versions of “loose lips sink ships” – both sides rely on courier-carried messages. But the break-up of the country and the proliferation of checkpoints, such as the one that sparked the AQAP-ISIS clash, has made even this style of communication difficult.

Key leaders and commanders can no longer communicate quickly or effectively with their troops in the field. Messaging and media, an important part of each group’s platform, take longer to coordinate and, at times over the past year, have seemed almost contradictory. One al-Qaeda group in one part of Yemen might say one thing, while another al-Qaeda group in another part of Yemen is saying something else.

The result of all this chaos and confusion has been fragmentation and freelancing, local fighters taking matters into their own hands with less and less instruction from the central leadership of each group. This fracturing of command is what led to the recent fight between AQAP and ISIS.

The two groups have lived side by side in al-Baydha, the central Yemeni governorate where the clash took place, for years, often placing their camps right next to one another. And while there was periodic sniping back and forth through their respective media wings, or defectors from one side joining the other, that was as far as it went. In Yemen, al-Qaeda and ISIS had what amounted to a tacit non-aggression pact. They called each other names, they excommunicated one another, but they didn’t fight.

That is no longer the case. Yemen’s two main jihadi groups are on their heels and at each other’s throats. But as welcome as that may be, it is unlikely to last. Just as the current war in Yemen has fractured AQAP and ISIS so too will its eventual end reinvigorate them.

The war has been too brutal and too sectarian for a tidy aftermath. Too many individuals have been radicalized to the point that they won’t simply lay down their arms when the fighting is over. They’ll keep going and al-Qaeda and ISIS will be there to welcome them. This has happened before. Most notably, in Iraq after the U.S. withdrew in 2011. But it doesn’t have to happen this time.

AQAP and ISIS are vulnerable in Yemen in a way they’ve never been before. The U.S. should do everything in its power to continue to decimate these organizations while simultaneously pushing for a quick end to this war. But it should do so with the idea that as soon as the fighting stops the U.S. will lead the way with development aid and help to stitch the country back together again. This will not be easy and it will not be quick. But U.S. has to deal with both the immediate threat and the future threat, rollback the AQAP and ISIS that exist today while also preventing new recruits from joining tomorrow. Because if it fails on either count AQAP and ISIS will resurrect themselves in Yemen and when they do they’ll be a lot stronger than they are at the moment.

Photo by Brent Stirton/Getty Images