The deportation of Azerbaijanis from Armenia represents one of the most tragic consequences of the Armenian-Azerbaijani conflict. We can isolate 3 main phases in this massive 20th-century deportation.
Main stages of the mass deportation of Azerbaijanis from Armenia.
1918-1920
It was the very notorious plan to create the mythical "Greater Armenia" that prompted genocide and expulsion of Azerbaijani population from Armenia between 1918 and 1920.

Striving for land gains and artificial expansion of ethnic territory, combined with the idea of cultural supremacy and special rights to habitats, were dominant at that time in the Armenian society. Armenian chauvinists believed the "Greater Armenia" could be founded not on the free will of the population majority but rather 'instilled' by force, build by steel and blood on the ruins and dead bodies of "outlanders", with Muslims (Azerbaijanis) wiped out from these lands.

This cunning plan to establish a Lebensraum for the "Greater Armenia", first in the realms of the Ottoman Empire and then, during 1918-1920, in the South Caucasus, was from its very onset destined to culminate in a violent standoff and genocide of Muslim (Azerbaijani) community.

The tragic events in Irevan Governorate uyezds (districts) that later on (in May 1918) would be included into the first-time Armenian state in the South Caucasus almost coincided with those in the east of the Northern Azerbaijan, in Baku Governorate, where Bolshevik and Dashnak militants of the Baku Council committed genocide of Azerbaijani population in spring 1918.
Armenian militants were armed to the teeth and had a vast experience of wiping out the local Turkic population in the Eastern Anatolia. They learned it during the World War I, when, falling back from the Caucasian Front lines together with the Russian army early in 1918, they decimated Azerbaijanis throughout the Irevan Governorate. To have a full picture of violence against the Azerbaijani community, one may review the "List of Razed And Abandoned Muslim (Azerbaijani) Villages in Irevan Governorate as of March 1918".

This list includes 199 villages in Irevan, Surmalin, Echmiadzin, and Novobayazet uyezds (districts) of the Irevan Governorate, which were razed to the ground by Armenian militants and abandoned by their Muslim population [1]. In doing so, the former stopped at nothing: decimation of civilians, massacres, atrocities, intimidation, spread of panic — anything would do to expel the local population from the lands their ancestors had inhabited for centuries. By occupying these areas, they artificially created densely populated Armenian habitats, continuously growing and expanding due to inflow of Armenian refugees from Turkey.

Once the first Armenian state in the South Caucasus, Republic of Ararat with an original area less than 10 thousand square kilometers, was founded within the borders of the Irevan Governorate late in May 1918, genocide policy was elevated to the state level.

That happened despite the 4 June 1918 Treaty of Batum with the Ottoman Empire, whereby (ref. item 6) the government of Armenia agreed to ensure security and free development for Muslims (Azerbaijanis) residing in the country, and to permit unobstructed education and religious practices in their mother tongue.

When the Azerbaijan National Council ruled on 29 May 1918 to cede the town of Irevan [2] to Armenia as a capital, it had devastating consequences for its Azerbaijani populace (according to the Caucasian Calendar, 12,605 Azerbaijanis were residing there as of 1 January 1916) [3].

The 29 June 1919 issue of Azerbaijan newspaper cited a person who had witnessed the oppression of Muslim community in Irevan: «The Muslims (Azerbaijanis) are so defenseless and outlawed in Erivan that in broad daylight (let alone at night) they are robbed of their clothes, if those are of any value whatsoever, even in the Muslim (Azerbaijani) quarters of the town. Likewise, they are robbed of money and other values... Even houses that belong to Muslims (Azerbaijanis) are not spared; armed to the teeth, Armenian cutthroats break in and steal "excess" belongings. All that is still happening in Erivan, the capital of Armenia. The torment and hardships the Muslims (Azerbaijanis) have suffered in Erivan are simply beyond any description. Many can't stand it and lose their mind, some get old before their time... This is how Muslims (Azerbaijanis) live in the town." [4]
During 17 through 31 August 1919, up to 50 Muslim (Azerbaijani) villages in Irevan, Surmalin, Echmiadzin, and Novobayazet uyezds were razed to the ground [5].

Describing the bloodshed in the Irevan Governorate and economic difficulties its Muslim population was facing, Commissioner of Azerbaijan's Ministry of Patronage in Armenia T. Makinski wrote on 2 September 1919 to the Minister of Patronage: "The last days' events were a tragedy to the Muslim (Azerbaijani) population; 50 to 60 villages, where dwellers returned home, have been razed again, with survivors leaving their belongings and bread in storages and fleeing for their life… Up to 150,000 Muslims (Azerbaijanis) have emigrated from Novobayazet, Echmiadzin, and Erivan uyezds.

There is still a small number of Muslims (Azerbaijanis) within Armenia, yet it is diminishing as people flee in fear of pogroms and oppression. There are no more Muslims (Azerbaijanis) in Novobayazet District. Approximately 25,000 Muslims (Azerbaijanis) are residing in Erivan Uyezd's areas under Armenian government's control; the same number is reported in Echmiadzin (25,000), and 15,000 in Surmalin (again, only in the areas controlled by Armenian government). Besides, 13,000 refugees and locals are residing in Erivan. There have always been very few Muslims (Azerbaijanis) in Alexandropol Uyezd. If we sum up the number of destitute Muslims (Azerbaijanis) across the Erivan Governorate, it will be 70,000 to 80,000 people.

The Muslim (Azerbaijani) population in question is in a terrible situation: no bread in stock, no seeds, no farm stock, no cattle, and most of them have no shelter. They are starving, impoverished, driven to despair. The overwhelming majority of Muslim (Azerbaijani) population in Armenia does not have any crops, and those who would not suffer new pogroms have been virtually deprived of their lands (which were leased and taken away) [6]."

During the last 2 months of 1919, Armenian militants once again razed 62 villages in Echmiadzin, 34 in Surmalin, and all Muslim (Azerbaijani) villages (save Zangibasar) in Irevan Uyezd [7].

As the Ministry of Patronage reported, over 200 thousand people fled the destroyed Muslim (Azerbaijani) villages of Novobayazet, Irevan, and Echmiadzin uyezds as of the late 1919 [8].They mostly settled in Nakhchivan, Sharur, Gazakh, Ganja, and Shamakhi.

N.I. Solovyov, Chairman of the Azerbaijan SSR Council of National Economy, described the hardships of Armenia's Azerbaijani community in his 1920 memo "Our Policy in Azerbaijan Over 2 Months (May-June) After The Takeover", addressed to the RSFR Council of People's Commissars Chairman V.I. Lenin. He wrote that "there were 250 Muslim (Azerbaijanis) villages within when Armenian republic, but all of them have been razed to the ground, so there is no single Muslim (Azerbaijani) there [9]."
Large-scale violence against Azerbaijani population in the Erivan Governorate has also been reflected in Armenian historians' articles. Armenian historian A. Lalayan writes: "During the Dashnaktsutiun dictatorship (1918-1920), all non-Armenian population was outlawed. Over two and a half years at the helm, Dashnaktsutiun bayonetted Azerbaijanis residing in Armenia into submission, killing and robbing civilians, razing towns and villages [10]."

Lalayan goes on writing that the Turkic (Azerbaijani) community of Armenia was reduced by 77% [11] over 30 months of Dashnaktsutiun in charge of the country.

All in all, the very existence of the 1918-1920 First Republic of Armenia was a clear display of Armenian politicians having created the state authority not to govern the country, but rather to eradicate the Azerbaijanis population and seize its properties. Those events demonstrated that Armenians, boasting their 'civility' and 'ancient history', were in fact not mature enough to have a state of their own, let alone rule other nations.
1948-1953
During the Soviet era, Azerbaijanis kept leaving Armenia for good. This process gained traction after the World War II and was a permanent trend right until the collapse of the Soviet Union.

Endorsed by Joseph Stalin, the USSR Council of Ministers on 23 December 1947 resolved to relocate Azerbaijani population from the Armenian SSR to the Kura-Araz Lowland. Pursuant to this Decree, the Azerbaijani community of Armenia (ca. 100 thousand people) had to be resettled in 1948-1950.
Resolution of the Council of Ministers of the USSR No. 4083 on the resettlement of collective farmers and other Azerbaijani population from the Armenian SSR to the Kura-Araks lowland of the Azerbaijan SSR
According to the "Narkhozuchet" and the Ministry of Agriculture of the Armenian SSR, before the resettlement in 1948, 25 thousand families or about 110 thousand Azerbaijanis lived in Armenia. Of these, only 9 thousand families or 35 thousand people lived in low-lying regions, the remaining 75 thousand lived in the high-mountain regions of the Armenian SSR [12].

Such deportation was caused by pretended repatriation of Armenians residing in the USA, Europe, Middle East etc. With Azerbaijani population driven out of Armenia, it was much easier to accept and settle Armenians coming from overseas. Pursuant to the above Decree, buildings and houses abandoned by Azerbaijani people were used to accommodate these newcomers [13].

In fact, Azerbaijani people were stripped of their history and cultural heritage, let alone housing and lands they had inherited from their fathers.
Whatever the case, it is evident that they failed to resettle the planned number of Azerbaijani families from Armenia within the set timeframe. The USSR Council of Ministers therefore adopted on 6 September 1950 new Resolution titled "Resettlement to Collective Farms of The Kura-Araz Lowland (Azerbaijan SSR) in 1951-1955". Pursuant to this Resolution, 15 thousand Azerbaijani families from the countryside and towns were supposed to be moved from the Armenian SSR [14].

By extending the resettlement campaign, Moscow was striving to finally achieve the required bar of 100 thousand people as stipulated by previous decrees dated 23 December 1947 and 10 March 1948, respectively. According, however, to the 13 October 1953 letter from the Azerbaijan SSR's Minister of Agriculture I. Abdullayev to the Azerbaijan Communist Party CC Secretary I. Mustafayev and Council of Minister Chairman T. Guliyev, the actual number of settlers from the Armenian SSR to the Kura-Araz Lowland during 1948-1953 was 53,000 (11,914 families) [15].

This deportation is comparable with that of, say, the Chechens and Ingush, Balkars, Karachays, and other nations to Kazakhstan and Central Asia. It was a deportation as it was carried out against the will of people subjected to resettlement. Their life effectively destroyed, dozens of thousands of people had to start from scratch and adapt to new conditions, new environment, and new activities.

The resettlement process has gone downhill ever since Stalin passed away in 1953. On the one hand, it was due to the failure by the Soviet government to resettle the expected number of Azerbaijani people within the set timeframe, and on the other due to the sharp decline in inflow of Armenian immigrants wishing to abandon a convenient Western lifestyle for challenging social and living conditions they were facing in the Soviet Armenia. The outflow of Azerbaijanis from Armenia persisted nevertheless. Fully realizing their second-class position in Armenia, their exodus was inevitable; it was a permanent trend right up to the collapse of the Soviet Union.
National leader of the Azerbaijan Heydar Aliyev
In his 18 December 1997 Decree, President Heydar Aliyev of Azerbaijan provided the first ever political and legal assessment of Azerbaijanis' deportation from Armenia in 1948-1953. It was specifically mentioned in this Decree that, apart from criminal politics led by Armenian chauvinistic circles and the Soviet government, it was the Azerbaijani authorities' position of that time that had conflicted with national interests. The involvement of the latter in criminal activity against our compatriots was also pointed out in the Decree [16].
1988-1991
The final, yet the most tragic (scale- and approach-wise) deportation of Azerbaijani people from Armenia occurred in 1988-1991. Unlike that of 1948-1953, it coincided with Armenia unfolding its territorial claims to Azerbaijan and was therefore unusually severe. To make matters worse, this time Azerbaijani people were in a completely hopeless situation as the deportation was directly supported by Armenia's administrative and law-enforcement bodies, who maintained the lands Azerbaijanis inhabited had historically belonged to Armenians.

The bulk of Azerbaijani refugees were villagers who were forced to abandon their homelands, grazing lands, fields, and gardens their ancestors had worked at for centuries. Only a small percentage of our nationals was represented by dwellers of small industrial towns and Yerevan (Irevan) itself.

The Azerbaijani people had a good command of Armenian language and used it as fluently as their own mother tongue, Azerbaijani. And still Armenians would not let them forget that they are aliens, the 'Turks'.

Once the deportation started, Azerbaijani delegations from different regions of Armenia and thousands of individuals filed complaints to the highest echelons of power, to the party leaders and the government, signaling their concern over violent incidents against them and pleading to stop the lawlessness.

Insulted and humiliated, people who lost their loved ones and home still craved for justice rather than retribution. But their pleas were left unanswered. According to the Azerbaijan SSR Council of Ministers, there were over 78 thousand refugees from Armenia in the republic as of 2 December 1988 [17]. The 1989 All-Union census reported 84,860 Azerbaijanis still residing in the Armenian SSR, who were forced to leave it by 1990 [18].

Accommodated in temporary resettlement facilities, refugees were then dispatched to final settlement locations. With Azerbaijanis driven out of Armenia, the Armenian-Azerbaijani conflict gained traction.

As the USSR Constitution was grossly violated, the Soviet leadership kept making their decisions on the premises that order could be restored by disciplining individual managers, ministers, or law enforcement officers, yet this clearly political process had already acquired a power of erupting volcano [19]. The content of decisions made in Moscow was a bright evidence of the central power having always stuck to the approach whereby both aggrieved parties bore equal responsibility in any critical situation, no matter who had triggered it and where first streams of refugees had come from.

Failing to realize or assess humanitarian and political ramifications of the tragedy, the leadership in Moscow could not comprehend that it would eventually propagate to all localities where Armenians and Azerbaijanis lived side by side. Whatever the Soviet leadership's intention was, the ambiguous nature of their political and management efforts combined with assigning equal responsibility to parties was the main reason why the process spiraled out of control, causing increasingly heated debates between the conflicting parties and distrust in central government on the both sides.

From 1988 on, the refugee issue for long years became an inherent factor of political and social life in Azerbaijan.

Recommended reading:
[1] History of Azerbaijan in Documents and Publications. Baku, 1990, pp.216-219.
[2] Minutes of Meeting of Muslim Factions in Transcaucasian Seym and Azerbaijan National Council. Baku, 2006, p.130.
[3] Caucasian Calendar-1917. Tiflis, 1916, pp.220-221.
[4] History of Azerbaijan in Documents and Publications, pp.322-323.
[5] Azerbaijan Democratic Republic. Foreign Policy (Documents and Materials), Baku, 1998.
[6] Genocide of Azerbaijani Nation in March 1918. In 3 volume. V. II, Book 2: Genocide in Irevan Govenorate. 1918-1920, pp.193-196
[7] History of Azerbaijan in Documents and Publications. Baku, 1990, pp.221-222.
[8] History of Azerbaijan in Documents and Publications. Baku, 1990, p.176.
[9] Russian State Archive of Social and Political History, Foundation 324, bordereau 2, folder 17, sheet 38.
[10] А.А. Lalayan. The Counter-Revolutionary Role of Dashnaktsutiun Party // News of Azerbaijan SSR Academy of Science. History, Philosophy, and Law Series, 1990, No. 1. pp.58-59.
[11] Ibid, p.63.
[12] Deportation of Azerbaijanis from the Armenian SSR (1948-1953). Collection of documents. Baku, 2013, p. 542.
[13] Ibid, pp.81-83.
[14] Ibid, p.464.
[15] Ibid, pp.671-672.
[16] http://genocide.preslib.az/ru_s12.html
[17] Baku Worker, 3 December 1988.
[19] Baku Worker, 7 December 1988.