A little over a month ago, I published an article here on the military strategy required to defeat Islamic State (ISIS). Tragically, a few days thereafter, one of my family members was struck down by ISIS terrorism, when a homicide bomber detonated himself next to a group of Israeli tourists in Istanbul, Turkey. Among those killed was my wife’s nephew, Yonatan (Yoni) Suher, an Israeli-American citizen.A few days after the terrorist attack in which Yoni was murdered, ISIS struck again – this time in Brussels, Belgium, killing dozens in the city’s airport. Attacks such as these prove that defeating ISIS is an urgent mission in which almost the entire world must be engaged.However, to defeat ISIS, a military strategy alone is insufficient. A diplomatic and political plan is also necessary, so as to ensure that the day after the victory belongs to those who oppose terrorism. ISIS is nourished by the Shi’ite-Sunni religious war in the Middle East. As long as the geopolitical situation encourages that war, rather than defusing it, this organization will continue to regenerate, even if it is defeated militarily.Past experience teaches us that leaders and military commanders invest deeply in how to win the battle, but do not always plan suitably for the day after victory. The most prominent examples of this phenomenon include the American “victory” over Saddam Hussein’s Iraq in 2003, and the “victory” of the Western coalition against the Gaddafi regime in Libya in 2011. In both cases, rapid military victory led to complete chaos, and chaos is the breeding ground of terrorism.In contrast, history also provides us with an opposite and positive example: the coordination between the Allied leaders at the end of the Second World War, and the US administration’s Marshall Plan, which allowed for the rebuilding of Europe and Japan out of their ruins, giving birth to decades of enduring peace and prosperity.Europe in 1945 was in no less severe a situation than is the Middle East of our times. However, the right combination of military victory and a smart diplomatic-economic strategy led to its reconstruction.How can a similar achievement be reached in the Middle East of our times, particularly in Iraq and Syria? First, we must understand that in the background of this religious, sectarian war are local struggles by various minority populations who are fighting to survive and safeguard any semblance they have of independence. The solution to this mess has to be based on a division of Syria and Iraq into four new countries, on an ethnic and religious basis, to provide each one of the various groups with a sense of security, independence and prosperity.The partition plan should take form as follows: 1) A Sunni state should be established in western Iraq and eastern Syria, whose borders would be similar (but not identical) to the areas now controlled by ISIS. The Sunnis are the majority population in Syria and form a large minority in Iraq. Yet today, they suffer slaughter and persecution in both countries. The independent Sunni state must be sure to allow significant political representation for the various Sunni tribes. Additionally, this country should be able to efficiently run its large oil and gas fields, which can form a basis for economic independence, prosperity and viability for many years to come.2) A Shi’ite state should be established in southeast Iraq, which, we can assume, will be under strong Iranian influence. Today, Shi’ite Iran effectively runs the affairs of the central government in Baghdad, and also exercises control over large Sunni tribes in other parts of Iraq. It is important to create a clear separation between the “Iranian Iraq” and the “Arab-Sunni Iraq.” Of course, to the extent that it is possible, one must seek a clear separation between the “Iranian Iraq” and the suffocating Iranian influence, but this is a more complex maneuver that can only be completed after the situation in the region becomes stable again.3) A Kurdish state ought to be founded in the territory of northern Syria and northern Iraq. This country already exists, in a de facto manner, as an independent Kurdish autonomy, with a military force that has proven itself in combat against ISIS. The world should recognize the Kurdish autonomy as a country in every way, yet at the same time must require that the Kurdish state publicly declare it has no territorial ambitions regarding Kurdish areas in southern Turkey. Doing so will ease Turkey’s concerns about the rise of a Kurdish state on its borders.4) An Alawite state can be forged in the Damascus region and along the Syrian coastline. This state would form a safe haven for the Alawite minority that ruled Syria in recent decades and today feels that it is fighting for its life against the widespread Sunni uprising in the country. As long as Alawites in Syria fear for their very existence, they will continue to support the murderous Assad regime and the Iranian militias that support it. The world must ensure an Alawite “passageway” from the coast to Damascus, while at the same time ensuring an independent state for Sunnis in Syria. Only a maneuver of this kind will begin to neutralize the sectarian land-mine in Syria, which has so far killed more than 300,000 people.5) Alongside these steps, the world powers must also ensure that all of the various new countries respect and safeguard the rights of other minorities living within their boundaries such as Christians, Druse and Assyrians.These groups should be represented within the political framework of the new country.The last time borders were drawn in the Middle East was in 1914, when European diplomats drew illogical borders based upon British and French zones of influence, while completely disregarding issues such as demographics, sectarianism, the economy, natural resources and other factors. The new borders should be drawn in precisely the opposite manner. They should be based almost exclusively on these issues, and, above all, along the lines of religious partition.The solution offered here will not please everyone. Turkey will fear the establishment of a Kurdish state on its border. Iran will resist the decrease of its net influence in Iraq. Israel and Jordan will also surely have concerns about the rise of a new Sunni state on their borders. Yet I believe that an exhibition of courageous American leadership in the region could mitigate most of these concerns. When the rulers of the Middle East become convinced that the US is not “pivoting away” from the area, and instead is willing to intervene to bring about solutions, it will also be possible to advance controversial but necessary initiatives.Finally, with regret, we must disabuse ourselves of the illusion that new countries established in the Middle East will necessarily be democratic.If and when a healthy democracy develops, that will be to the benefit of the world. In the near term, however, stability, security and economic prosperity should be the priorities.We should forgo the notion of parachuting democracy in from above, as attempted by the Bush administration in Iraq.The process outlined here ought to begin immediately, precisely at this time when the war against ISIS is at its most intense. The right way forward is through the assembly of an international committee, led by both the US and Russia, that will oversee an in-depth study of the region and formulate the new map. This committee will have to consult with all of the relevant leaders, but the final, independent decision will be its own.The more the world prepares itself for the day after, the greater the chances of preventing ISIS from rising again after its defeat.The author, a retired IDF major-general, is a senior policy and security adviser to the organization Our Soldiers Speak.