Gazakh is a rayon of Azerbaijan. It has two exclaves inside Armenia, Yukhari Askipara and Barkhudarli, both of which came under Armenian control during the Nagorno-Karabakh War.
In antiquity,this rayon was part of the province of Utik.The region was conquered by a succession of neighbouring powers or invaders, including Sassanid Persians, the Byzantine Empire, the Arabs, the Seljuq Turks, the Georgians, the Mongols, the Timurids, the Kara Koyunlu and Ak Koyunlu Turkoman tribes, and finally Safavid Iran.It was also ruled by Ottoman Empire between 1578 and 1607 and again 1722 and 1735.After the Russo-Persian War (1804-1813), the Russian Empire gained control of the area by virtue of the Treaty of Gulistan. Under Russian rule, it was part of Tiflis Governorate before forming the northeastern part of the Kazakh uyezd of the Elisabethpol Governorate in 1868.
A contemporary military historian noted the following ethnographic detail: "Abbas Mirza's route lay through the country of the great tribe of the Casaks, which is extremely strong and thickly wooded." He further notes that: "These have no connection with the Russian Cossacks. They are descended from men of the Kirgis Casaks, left by Genghis Khan. They are frequently called Kara Papaks, from wearing black sheep-skin caps."
When the South Caucasus came under British occupation, Sir John Oliver Wardrop, British Chief Commissioner in the South Caucasus, decided that assigning the Erivan Governorate and the Kars Oblast to Democratic Republic of Armenia (DRA) and the Elisabethpol and Baku Governorates to the Azerbaijan Democratic Republic (ADR) would solve the region's outstanding disputes. However, this proposal was rejected by both Armenians (who did not wish to give up their claims to Kazakh, Zangezur (today Syunik), and Nagorno-Karabakh) and Azerbaijanis (who found it unacceptable to give up their claims to Nakhichevan). As conflict broke out between the two groups, the British left the region in mid-1919.