The military campaign against the Islamic State has jelled, and ISIS defeats continue to mount. As shown in the ouster of Islamic State forces last week from Manbij in Syria and Sirte in Libya, the group’s fighters are now fleeing abroad or into the desert rather than fight to the death to hold untenable positions in cities and towns. Raqqa and Mosul will be next and at that point the war against ISIS in Syria and Iraq becomes a mopping-up operation, however bloody that may be.

Its morale broken and its administrative structures and military force collapsing, the ISIS operation is shifting from establishing a Muslim theocratic state and global authority to surviving as a collection of more or less coherent international terrorist networks. Across the world there may be even more terrorist attacks than before, but at a certain point jumping from one dismal assessment to another must give way to looking at the facts as they are. In the Middle East, numerous religious, ethnic, regional, and national conflicts remain to be addressed, but the Islamic State’s demise will be seen to be an event of historical consequence.

ISIS is the apotheosis of Islamist geopolitical jihad as launched by al-Qaeda in the late 1980s. It will have had a fearsome life, but its short-lived success is unlikely to be replicated, let alone surpassed. That Islamic State survives materially in some other, ultimately less unique and consequential form, is another matter. That other jihadist groups survive for the foreseeable future is also of lesser consequence. That the ideology of global jihad survives in a weakened form and still attracting certain numbers of recruits is also regrettable but not fundamental. Some fanaticisms need only time to burn themselves out.

The issue then is how to make the most of Islamic State’s destruction.

The greatest issue has to do with the present and future development of Islam in general, and Islam in the Arab world in particular. How the ISIS saga will be pondered and digested within Islam is an important element of world political and religious evolution.

A far from insignificant piece of that great debate involves what should be done with any ISIS leaders that are captured.

ISIS leaders must not escape accountability in some forum. Those responsible for Islamic State’s war crimes, crimes against humanity, and genocidal depredations must not be allowed to simply disappear into prisons or be executed. ISIS should not be allowed to evaporate into historical oblivion.

The International Criminal Court, flawed as it may be, is the appropriate institution because its specific mission is to enforce U.N. covenants on these most heinous of crimes. And the very fact that the United States for its own specific reasons is not a party to the ICC treaty will lend legitimacy to the court’s jurisprudence. ICC cases are only brought to indictment and trial by its own Office of the Prosecutor, not by states.

Trying ISIS leaders at the ICC will furthermore demonstrate that religious war as well as war crimes committed for other reasons can be tried and judged as legal matters within the purview of agreed international law itself.

Dealing with ISIS legally as well as militarily will create a historical record of high importance. In the last analysis, the war against Islamic State is a matter of political will.