Ayatollah Khomeini was the ruler of (or at least dominant figure in) Iran for a decade, from the founding of the Islamic Republic in April 1979 until his death in mid-1989. During that time the revolution was being consolidated as a theocratic republic under Khomeini, and Iran was fighting a costly and bloody war with Iraq.