The Iranian army has fought against two major invasions in contemporary times. The 1941 invasion by the Allies of World War II resulted in a decisive loss for the Iranian forces, the deposition of Iran's Shah and five years of subsequent occupation, while the 1980 Iraqi invasion began the Iran–Iraq War, which lasted almost eight years and ended in "status quo ante bellum". The army has also been actively engaged in quelling tribal and separatist rebellions beginning in the 1940s in order to protect Iran's territorial integrity.