How did the United States get into a war with Iraq? After the American hostages were seized in the Iranian embassy in 1979, American relations with Iran deteriorated.
The United States, to get even with Iran, encouraged Iraq to attack Iran and thereby started the Iran-Iraq war. Iran and Iraq are neighbors and tradition enemies. The Iran-Iraq war was a senseless slaughter, much like World War I, with the same human wave tactics and gas attacks. Israeli policy was to keep the war going. Iran and Iraq were both enemies of Israel.
In June 1981, Israel attacked and destroyed the Osirik nuclear reactor which Iraq had been building with French help. It was destroyed before it became operational. The reason for the attack was to prevent Iraq from developing a nuclear capability. The attack was carried out with American supplied F-16's. Under American law, weapons supplied by the United States government can only be used for "defensive" purposes.
The Israeli attack on the Osirik reactor was a violation of American law. But, in those early months of the Reagan Administration, no one cared. Everyone winked and blinked and laughed. The illegal act was done by the Israelis so normal operations of law don't count, of course.
Nevertheless, we still sided with Iraq in the war with Iran and supplied Iraq with satellite photos and intelligence data, while our allies around the world supplied Iraq with money to buy weapons.
One morning in 1986, Saddam Hussein wakes up to find that his tanks are being destroyed by Iranians armed with TOW missiles, an advanced American weapon system. Where did Iran get these missiles?
From the United States, naturally. When Iraq asked the United States what it was doing supplying its enemy with advanced weaponry, the answer was "Wha-a-a-a?" So, put yourself in Iraq's shoes. The United States urges Iraq into a war with Iran. Then Israel, the United State's best friend in the Middle East, attacks and destroys Iraq's nuclear power and weapons program. Then the United States starts supplying Iraq's enemy, Iran, with advanced weaponry. What kind of a friend is this?
Saddam Hussein knew that the United States through Israel was supplying TOW missiles to Iran, but he couldn't say anything because this was a top secret operation in the White House. So what did he do? An Iraqi jet "accidentally" fired an exocet missile into the United States Navy vessel Stark, killing 36 sailors. Ooups!
Reagan got the message. After the Iran-Contra scandal started coming out, the United States obligingly returned to supporting Iraq by "accidentally" shooting down an Iranian civilian airliner, killing all people on board. This ended the Iran-Iraq War.