In the aftermath of the occupation of Iran, those Allied forces agreed to withdraw from Iran within six months after the cessation of hostilities. However, when this deadline came in early 1946, the Soviets, under Joseph Stalin, remained in Iran. Soon, the alliance of the Kurdish and People's Azerbaijani forces, supported in arms and training by the Soviet Union, engaged in fighting with Iranian forces, resulting in a total of 2,000 casualties. Negotiation by Iranian premier Ahmad Qavam and diplomatic pressure on the Soviets by the United States eventually led to Soviet withdrawal and dissolution of the separatist Azeri and Kurdish states.