After graduating with honours, Aliyev was sponsored by philanthropist Zeynalabdin Taghiyev to enter the Russian Medical Military Academy in Saint Petersburg in 1917.
[1] Because of the October Revolution and civil unrest in the South Caucasus marked by political instability and ethnic cleansings, Aliyev had to return to Armenia in 1918 and fled with his family first to Shahtakhti (a town in Nakhchivan) and then to northern Iran.
The goal of his council (later known as the "Aziz Aliyev Group") was to establish ties with local Communists and to propagate Communism on political, social and cultural levels.
During the six years that he served in this position, Aliyev managed to put an end to hostility expressed by the locals towards the central government.
He openly supported the heritage of Imam Shamil, the 19th century Muslim leader of an anti-Russian resistance, that is well-celebrated by Dagestanis but had been frowned upon and dismissed by the Kremlin at the time due to its religious and nationalist nature.
Concerned by rumours of being replaced by Aliyev, Baghirov managed to have him fired from the executive power of Dagestan and sent to Moscow to work as an inspector in the Central Committee of the Communist Party of the Soviet Union.
The official reason behind this repression was the accusation that Aliyev never reported his parents' social origin; aggravated by the fact that his sister lived in Iran.