Ali Khamenei was not the President, but the Supreme Leader of Iran during the Iran-Iraq War, which lasted from 1980 to 1988. The President of Iran at the time was Abolhassan Banisadr until he was impeached in June 1981, and then was replaced by Mohammad-Ali Rajai, who was assassinated along with Prime Minister Mohammad-Javad Bahonar in August 1981.