Gardez (ګردېز / گردیز; Gardēz, meaning "mountain fortress" in Middle Persian) is the capital of the Paktia Province of Afghanistan. The population of the city was estimated to be ca. 10,000 in the 1979 census and was estimated to be 70,000 in 2008. The majority of the city's native population is Tajik. But recently, with the migration of Pashtun tribes from different parts of Paktia to this city, Pashtuns have taken over the majority of the population of this city. The city of Gardez is located at the junction between two important roads that cut through a huge alpine valley. Surrounded by the mountains and deserts of the Hindu Kush, which boil up from the valley floor to the north, east and west, it is the axis of commerce for a huge area of eastern Afghanistan and has been a strategic location for armies throughout the country's long history of conflict. Observation posts built by Alexander the Great are still crumbling on the hilltops just outside the city limits.
The city of Gardez has a population of 70,641 (in 2015). It has 13 districts and a total land area of . The total number of dwellings in this city is 7,849.
On 14 August 2021, Gardez was seized by Taliban fighters, becoming the nineteenth provincial capital to be captured by the Taliban as part of the wider 2021 Taliban offensive.
Gardez is an ancient settlement, located within a large intramountainous depression in the Sulaiman Mountains of eastern Afghanistan. Archaeological discoveries, including Greek, Sassanid, Hephthalite, and Hindu Shahi coins give an insight into the rich history of Gardez.
During 8th century, the Lawik rulers of the region adopted Islam. They formerly practiced either Hinduism or Buddhism, since they were associated with the Buddhist Kabul Shahis, and later with the Hindu Shahis (based in Gandhara, in present-day north-west Pakistan). Gardez later became a center of Kharijism and suffered several attacks by anti-Kharijite military chiefs.