In 1988, as the Soviet Union began to disintegrate, Armenia began demanding the transfer of Nagorno-Karabakh to Armenia. This led to an illegal resolution by the Armenian Parliament calling for the incorporation of Nagorno-Karabakh into the Armenian Soviet Socialist Republic. Thus Armenia started its undeclared war, with the goal of extending Armenian territory to the greatest degree possible at the expense of Azerbaijan. By 1991, around 250,000 Azerbaijanis, who had lived in Armenia for centuries, had been expelled. In the course of this, various atrocities were committed against the Azerbaijani civilian population.
At the beginning of 1992, Armenia began using foreign military and material assistance to intensify its occupation, starting with settlements in Nagorno-Karabakh. Kərkicahan was taken in January 1992, followed by Malıbəyli and Quşçular in February. The worst atrocity took place on February 26, 1992, when Armenian forces perpetrated a genocidal massacre against Azerbaijani civilians in the town of Xocalı. 613 Azerbaijanis were murdered. International journalists and an official Azerbaijani investigation reported disfigured corpses, dead women and children, and the murder of fleeing civilians. In 2011-12, several U.S. state legislatures and governors, including those of Georgia, New Jersey, Maine, Massachusetts and Texas passed resolutions and issued statements recognizing and commemorating victims of the Xocalı massacre.
After Xocalı, Ayaz Mutallibov, then President of Azerbaijan, lost popular confidence, and had to resign on March 6, 1992. Domestic chaos followed, which further weakened the defensive strength of the young Republic of Azerbaijan. On May 8, 1992 city of Şuşa was occupied. More than 50,000 ethnic Azerbaijanis were expelled
from Nagorno-Karabakh. Throughout the rest of 1992 and 1993 Armenian forces invaded a number of other districts including Laçın, Kəlbəcər, Ağdam, Füzuli, Cəbrayıl, Qubadlı and Zəngilan. Around 20,000 Azerbaijanis were killed and 100,000 wounded.
The United Nations unanimously condemned the occupation of Azerbaijani territory, and in 1993 the Security Council passed four resolutions (Nos. 822, 853, 874, 884) demanding the immediate and unconditional withdrawal of all Armenian forces from the occupied areas of Azerbaijan. Armenia, however, ignored these resolutions, and the UN Security Council did nothing to enforce compliance. Armenia also ignored resolutions of the European Parliament as well as the Parliamentary Assembly of the Council of Europe, which condemned the occupation and ethnic cleansing.
Only after major counterattacks by Azerbaijan in late 1993 and early 1994 was Armenia finally willing to agree to a ceasefire, agreed on 12 May 1994. However, Armenia continues to violate the truce with attacks on Azerbaijani soldiers and civilians around the front lines.
During the occupation, Armenia took control of 198 km of the border between Azerbaijan and Iran, which it uses for illegal trafficking of drugs, weapons and humans.