The Iran–Iraq War (; ) was a protracted armed conflict that began on 22 September 1980 when Iraq invaded neighbouring Iran. The war lasted almost eight years, ending in a stalemate on 20 August 1988 when Iran accepted a UN-brokered ceasefire. Iraq's rationale for the invasion was primarily to cripple Iran and prevent Ayatollah Ruhollah Khomeini from exporting the 1979 Iranian Revolution movement to Shia-majority Iraq and threaten the Sunni-dominated Ba'athist leadership. Iraq had also wished to replace Iran as the dominant state in the Persian Gulf, which was before this point not seen as feasible by the Iraqi leadership due to pre-revolutionary Iran's colossal economic and military might, as well as its close alliances with the United States and Israel. The war followed a long-running history of border disputes, as a result of which Iraq had planned to annex Iran's oil-rich Khuzestan Province and the east bank of the Shatt al-Arab (also known in Iran as the Arvand Rud).