In September 1980, Iraq launched a full-scale invasion of Iran, beginning the Iran–Iraq War (September 1980 – August 1988). A combination of fierce resistance by Iranians and military incompetence by Iraqi forces soon stalled the Iraqi advance and, despite Saddam's internationally condemned use of poison gas, Iran had by early 1982 regained almost all of the territory lost to the invasion. The invasion rallied Iranians behind the new regime, enhancing Khomeini's stature and allowing him to consolidate and stabilize his leadership. After this reversal, Khomeini refused an Iraqi offer of a truce, instead demanding reparations and the toppling of Saddam Hussein from power. In 1982, there was an attempted military coup against Khomeini. The Iran–Iraq War ended in 1988, with 320,000–720,000 Iranian soldiers and militia killed.