In the US we still think of Iran taking hostages after the 1979 Islamic Revolution. Of course they overthrew the Shah, whose power had been consolidated with the help of the CIA (after the overthrow of Prime Minister Mossadegh). The US backed Iraq in the 8 year Iran-Iraq war, though in hindsight this didn’t go well, shortly after it ended Iraq under Saddam Hussein invaded Kuwait – which had provided billions for his anti-Iran crusade.
Iran came to the table for peace, helping to end the war in a stalemate, shortly after the US shot down a civilian Iran Air flight in 1988. They may have believed that the US was openly joining Iraq’s fight and would stop at nothing.