Under Reagan the US supported Iraq openly with weapons an technologies, while they also sold weapons to Iran via Israel, they bet on both ponies, and these sales helped the US fund the CIA-trained Nicaraguan Contras (aka death squads) chase the red-herring that was Communism in Central America.