Throughout much of the Cold War, Syria and Iraq were each ruled by rival fractions of the pan-Arab Baath Party and the two nations were often tense towards one another despite their close relations with the Soviet Union. Their relationship, which had been lukewarm at best since 1963, started to change in a dramatic fashion when Mohammad Reza Pahlavi, the Shah of Iran, was overthrown in February 1979 and replaced with the pro-Islamist regime of Ayatollah Ruhollah Khomeini. After seizing power, Khomeini established a system of laws which required the mostly Shiite population of Iran to follow strict adherence to the Twelver school of thought. Assad, himself a Shiite, soon formed a strong alliance with Iran and sought to use this new relationship to greatly weaken Iraq. On July 16, 1979, Ahmed Hassan al-Bakr, who had ruled Iraq following a coup in 1968, stepped down from power and appointed his cousin Saddam Hussein, a strongly anti-Shiite Sunni, to be his successor and the Syrian government officially closed its embassy in Baghdad soon afterwards. In 1980, relations between Iraq and Syria officially broke apart when Syria declared its support for Iran during the Iran–Iraq War and Hussein, hoping to gain the advantage over Iran, expanded relations with the Western nations and recanted Iraq's previous position towards Israel.