The city appears in the historical record in 1336 by its Greek name, Argyrokastro, as part of the Byzantine Empire. It later became the center of the local principality under the Albanian lord, Gjon Zenebishi (1373-1417), before falling under Ottoman Empire rule for the next five centuries. Taken by the Greek Army during the Balkan Wars, it was eventually incorporated into the newly independent state of Albania in 1913. This proved highly unpopular with the local Greek part of population, who rebelled and after several months of guerilla warfare established the short-lived Autonomous Republic of Northern Epirus with Gjirokaster as its capital in 1914. It was definitively awarded to Albania in 1921.
Alongside Albanians, the city is home to a Greek minority.
The name comes from the Medieval Greek ἀργυρόν (argyron), meaning "silver", and κάστρον (kastron), from the Latin castrum meaning "castle" or "fortress", thus "silver castle". The theory that the city took the name of the Princess Argjiro, a legendary figure about whom 19th author Kostas Krystallis wrote a short novel and Ismail Kadare wrote a poem in the 1960s, it is considered a folk etymology, since the princess is said to have lived later, in the 15th century.
Archaeologists have found pottery objects of the early Iron Age in Gjirokastër, which first appeared in the late Bronze Age in Pazhok, Elbasan District, and are found throughout Albania. The earliest recorded inhabitants of the area around Gjirokastër were the Greek tribe of the Chaonians.
The city's walls date from the 3rd century AD. The high stone walls of the Citadel were built from the 6th to the 12th century. During this period, Gjirokastër developed into a major commercial center known as Argyropolis or Argyrokastron.
According to Turkish traveller Evliya Çelebi, who visited the city in 1670, at that time there were 200 houses within the castle, 200 in the Christian eastern neighborhood of Kyçyk Varosh (meaning small neighborhood outside the castle), 150 houses in the Byjyk Varosh (meaning big neighborhood outside the castle), and six additional neighborhoods: Palorto, Vutosh, Dunavat, Manalat, Haxhi Bey, and Memi Bey, extending on eight hills around the castle. According to the traveller, the city had at that time around 2000 houses, eight mosques, three churches, 280 shops, five fountains, and five inns.
In 1811, Gjirokastër became part of the Pashalik of Yanina, then led by the Albanian-born Ali Pasha, and was transformed into a semi-autonomous fiefdom in the southwestern Balkans until his death in 1822. After the fall of the pashalik in 1868, the city was the capital of the sandjak of Ergiri (the Turkish name for Gjirokastër). On 23 July 1880, southern Albanian committees of the League of Prizren held a congress in the city, in which was decided that if Albanian-populated areas of the Ottoman Empire were ceded to neighbouring countries, they would revolt. During the Albanian National Awakening (1831–1912), the city was a major centre of the movement, and some groups in the city were reported to carry portraits of Skanderbeg, the national hero of the Albanians during this period.
Given its minority of Greek population, the city was claimed and taken by Greece during the First Balkan War of 1912–1913, following the retreat of the Ottomans from the region. However, it was awarded to Albania under the terms of the Treaty of London of 1913 and the Protocol of Florence of 17 December 1913.
This turn of events proved highly unpopular with the local Greek population, and their representatives under Georgios Christakis-Zografos formed the Panepirotic Assembly in Gjirokastër in protest. The Assembly, short of incorporation with Greece, demanded either local autonomy or an international occupation by forces of the Great Powers for the districts of Gjirokastër, Saranda, and Korçë. In March 1914, the Autonomous Republic of Northern Epirus was declared in Gjirokastër and was confirmed by the Great Powers with the Protocol of Corfu. The Republic, however, was short-lived, as Albania collapsed at the beginning of the First World War. The Greek military returned in October–November 1914, and again captured Gjirokastër, along with Saranda and Korçë. In April 1916, the territory referred to by Greeks as Northern Epirus, including Gjirokastër, was annexed to Greece. The Paris Peace Conference of 1919 restored the pre-war status quo, essentially upholding the border line decided in the 1913 Protocol of Florence, and the city was again returned to Albanian control.
In April 1939, Gjirokastër was occupied by Italy following the Italian invasion of Albania. In December 8, 1940, during the Greco-Italian War, the Greek Army entered the city and stayed for a five-month period before capitulating to the Germans in April 1941 and returning the city to Italian command. After Italy's capitulation in September 1943, the city was taken by German forces, and eventually returned to Albanian control in 1944.
The postwar Communist regime developed the city as an industrial and commercial centre. It was elevated to the status of a museum town, as it was the birthplace of the Communist leader of Albania, Enver Hoxha, who had been born there in 1908. His house was converted into a museum.
The city's only remaining mosque, Gjirokastër Mosque, built in 1757
In 1925, Albania became the world center of Bektashism, the most moderate Muslim sect. The sect was headquartered in Tirana, and Gjirokastër was one of six districts of the Bektashism in Albania, with its center at the tekke of Asim Baba. The city retains a large Bektashi and Sunni Muslim population. Historically there were 15 and tekkes and mosques, of which 13 were functional in 1945. Only Gjirokastër Mosque has survived; the remaining 12 were destroyed or closed during the Cultural Revolution of the communist government in 1967.
The city is home to an Eastern Orthodox diocese, part of the Orthodox Church of Albania.
17th-century Ottoman traveller Evliya Çelebi, who visited the city in 1670, described the city in detail. One Sunday, Çelebi heard the sound of a vajtim, the traditional Albanian lament for the dead, performed by a professional mourner. The traveller found the city so noisy that he dubbed Gjirokastër the "city of wailing"
“...Qyteti i hapur është vendosur mbi 8 kodra dhe luginat nga të gjitha anët e kalasë, me shtëpi shumëkatëshe, me çati prej guri dhe të rrethuara nga kopshte dhe hardhi. Secila nga këto shtëpi të ndërtuara mirë ka një kullë. Muret rrethuese të oborreve janë të ndërtuara me një lloj graniti të bardhë, punuar nga mjeshtra gurgdhendës, sikur të ishin tulla Ankaraje prej balte. Mure të tilla kanë si të pasurit ashtu edhe të varfrit. Gurë të prerë në formë katrore nuk gjenden veçse në qytetet e Tirit dhe Manisës në Anadoll... Mënyra e ndërtimit të mureve të jashtme të shtëpive nuk ka shoqe në botë. Ato janë të gjitha 20 inç të larta, të bëra me blloqe guri ranor të kuq, thjesht të vendosura gur mbi gur, pa baltë, gëlqere apo llaç për t’i lidhur. Muret dhe shtëpitë janë qindravjeçare që nga koha e të pafeve. Qyteti ka një klimë shumë të mirë dhe për këtë arsye, banorët kanë fizik të shëndetshëm... Gjirokastritët mbajnë zi për të afërmit e vdekur për 40-50 apo edhe 80 vjet... për këtë arsye unë e quajta Gjirokastrën “qyteti i vajtimit”. Është çudi e madhe se si vajtojcat profesioniste vajtojnë me kaq ndjenjë...”
The novel Chronicle in Stone by Albanian writer Ismail Kadare tells the history of this city during the Italian and Greek occupation in World War I and II, and expands on the customs of the people of Gjirokastër. At the age of twenty-four, Albanian writer Musine Kokalari (daid in jail of the communist regime) wrote an 80-page collection of ten youthful prose tales in her native Gjirokastrian dialect: As my old mother tells me, Tirana, 1941. The book tells the day-by-day struggles of women of Gjirokastër, and describes the prevailing mores of the region.
Gjirokastër, home to both Albanian and Greek polyphonic singing, is also home to the National Folklore Festival (Albanian: Festivali Folklorik Kombëtar) that is held every five years. The festival started in 1968 and was most recently held in 2015. It takes place on the premises of Gjirokaster Castle. Gjirokaster is also where the Greek language newspaper Laiko Vima is published. Founded in 1945, it was the only Greek-language printed media allowed during the Socialist People's Republic of Albania.
The city is built on the slope surrounding the citadel, located on a dominating plateau. Although the city's walls were built in the third century and the city itself was first mentioned in the 12th century, the majority of the existing buildings date from 17th and 18th centuries. Typical houses consist of a tall stone block structure which can be up to five stories high. There are external and internal staircases that surround the house. It is thought that such design stems from fortified country houses typical in southern Albania. The lower storey of the building contains a cistern and the stable. The upper storey is composed of a guest room and a family room containing a fireplace. Further upper stories are to accommodate extended families and are connected by internal stairs. Since Gjirokastër's membership to UNESCO, a number of houses have been restored, though others continue to degrade.
Many houses in Gjirokastër have a distinctive local style that has earned the city the nickname "City of Stone", because most of the old houses have roofs covered with flat dressed stones. A very similar style can be seen in the Pelion district of Greece. The city, along with Berat, was among the few Albanian cities preserved in the 1960s and 1970s from modernizing building programs. Both cities gained the status of "museum town" and are UNESCO World Heritage sites.
The Gjirokastër Castle dominates the town and overlooks the strategically important route along the river valley. It is open to visitors and contains a military museum featuring captured artillery and memorabilia of the Communist resistance against German occupation, as well as a captured United States Air Force plane, to commemorate the Communist regime's struggle against the imperialist powers. Additions were built during the 19th and 20th centuries by Ali Pasha of Tepelene and the Government of King Zog. Today it possesses five towers and houses a clock tower, a church, water fountains, horse stables, and many more amenities. The northern part of the castle was turned into a prison by Zog's government and housed political prisoners during the communist regime.
Gjirokastër features an old Ottoman bazaar which was originally built in the 17th century and rebuilt in the 19th century after a fire. There are more than 500 homes preserved as "cultural monuments" in Gjirokastër today. The Gjirokastër Mosque, built in 1757, dominates the bazaar.
When the town was first proposed for inclusion on the World Heritage list in 1988, International Council on Monuments and Sites experts were nonplussed by a number of modern constructions which detracted from the old town's appearance. The historic core of Gjirokastër was finally inscribed in 2005, 15 years after its original nomination.