More precisely, the origins of the Iran-Iraq war of 1980–1988 go back to the question of sovereignty over the resource-rich province of Khuzestan.
Just as the Shah had been overthrown, and his autocratic government replaced with an Islamic system, so could kings and dictators in the Sunni world.
In the end both were surprised to find their expected allies turning against them as invaders.
The UN Secretary General report dated December 9, 1991 (S/23273), explicitly states "Iraq's aggression against Iran" in starting the war and breaching International security and peace.
The aftermath of the Iranian Revolution of 1979 was central to the conflict.
The Ayatollah Ruhollah Khomeini was threatening to export Islamic revolution to the rest of the Middle East, even though Iran was hardly in any position to do so militarily, for most of the Shah's army had already been disbanded.