Why did the United States sell arms to Iran in the 1980's

Why did the United States sell arms to Iran in the 1980’s