Aghdam (Azerbaijani: Ağdam) is a ghost town and the nominal capital of the Aghdam District of Azerbaijan. Founded in the 18th century, it was granted city status in 1828 and grew considerably during the Soviet period. Aghdam lies 26 km (16 miles) from Stepanakert at the eastern foot of the Karabakh Range, on the outskirts of the Karabakh plain. Before the First Nagorno-Karabakh War, butter, wine and brandy, machine, and silk factories, an airport and two railway stations functioned there. By 1989, Aghdam had 28,031 inhabitants. As Azerbaijani forces withdrew from Karabakh following political turmoil in the country during the war, Armenian forces captured Aghdam in July 1993. The heavy fighting forced the city's population to flee eastwards. Upon the seizure, Armenian forces sacked the town. Until 2020, it was almost entirely ruined and uninhabited. As part of an agreement that ended the 2020 Nagorno-Karabakh war, the town and its surrounding district came under Azerbaijani control on 20 November 2020.