Even though some sources from medieval Islamic time attribute the building of the town to a Muslim Arab ruler, modern historians believe that the fact that the name Ganja derives from the New Persianganj ("treasure") and in Arabic source the name is recorded as Janza (from the Middle Persianganza) suggests that the city existed in pre-Islamic times and was likely founded in the 5th century. According to some sources, it changed hands between Persians, Khazars and Arabs even in the 7th century. The area in which Ganja is located was known as Arran from the 9th to 12th century; its urban population spoke mainly in the Persian language.
According to medieval Arabic sources, the city of Ganja was founded in 859-60 by Muhammad ibn Khalid ibn Yazid ibn Mazyad, the Arab governor of the region in the reign of the caliph al-Mutawakkil, and so-called because of a treasure unearthed there. According to the legend, the Arab governor had a dream where a voice told him that there was a treasure hidden under one of the three hills around the area where he camped. The voice told him to unearth it and use the money to found a city. He did so and informed the caliph about the money and the city. Caliph made Muhammad the hereditary governor of the city on a condition that he would give the money he found to the caliph.
Foundation of the city by Arabs is confirmed by the medieval Armenian historian Movses Kagankatvatsi, who mentions that the city of Ganja was founded in 846-47 in the canton of Arshakashen by the son of Khazr Patgos, "a furious and merciless man".
Silver coin of Abbas II (r. 1642-1666), minted in Ganja, dated 1658/9 (left = obverse; right = reverse)
The people of Ganja experienced a temporary cultural decline after an earthquake in 1139, when the city was taken by king Demetrius I of Georgia and its gates taken as trophies which is still kept in Georgia, and again after the Mongol invasion in 1231. The city was revived after the Safavids came to power in 1501, and incorporated all of Azerbaijan and beyond into their territories. The city came under brief occupation by the Ottomans between 1578–1606 and 1723-1735 during the prolonged Ottoman-Persian Wars, but nevertheless stayed under intermittent Iranian suzerainty from the earliest 16th century up to the course of the 19th century, when it was forcefully ceded to neighbouring Imperial Russia.
16th-19th centuries and Iran's ceding to Russia
Silver coin of Fath-Ali Shah Qajar (r. 1797-1834), minted in Ganja, dated 1802/3 (left = obverse; right = reverse)
For a short period, Ganja was renamed Abbasabad by Shah Abbas after war against the Ottomans. He built a new city 8 kilometres (5 miles) to the southwest of the old one, but the name changed back to Ganja during the time. During the Safavid rule, it was the capital of the Karabakh province. In 1747, Ganja became the center of the Ganja Khanate for a few decades following the death of Nader Shah, until the advent of the Iranian Zand and Qajar dynasties. The khans/dukes who de facto self-ruled the khanate, were subordinate to the central rule in mainland Iran and were from a branch of the Iranian Qajar family.
From the late 18th century, Russia actively started to increase its enroachments into Iranian and Turkish territory to the south. Following the annexation of eastern Georgia in 1801, Russia was now keen to conquer the rest of the Iranian possessions in the Caucasus. Russian expansion into the South Caucasus met particularly strong opposition in Ganja. In 1804, the Russians, led by General Pavel Tsitsianov, invaded and sacked Ganja, sparking the Russo-Persian War of 1804-1813. Some western sources assert that "the capture of the city was followed by a massacre of up to 3,000 inhabitants of Ganja by the Russians". They also claim that "500 of them were slaughtered in a mosque where they had taken refuge, after an Armenian told the Russian soldiers that there might have been "Daghestani robbers" among them".
Reconstruction in the 21st century has led to dramatic changes in the city's urban development, transforming the old Soviet city into a hub of high-rise, mixed-use buildings.
In 2008, Ganja Mausoleum Gates were built on the basis of sketches of ancient Ganja gates made by local master Ibrahim Osman oglu in 1063.
Ganja, located 400–450 meters (1312 to 1476 ft) above the sea level, lies on the Ganja-Gazakh plain in the Kur-Araz lowland in the west of Azerbaijan, 375 km (33 mi) away from Baku. It is situated at the north-eastern foothills of the Lesser Caucasus mountain ranges on the Ganjachay river.
The city borders on the administrative rayons of Goygol to the south, west and north-west and Samukh to the north-east.
Today, Ganja is divided into 2 rayons (administrative districts). The mayor, presently Niyazi Bayramov  embodies the executive power of the city. Ganja includes 6 administrative settlements, namely Hajikend, Javadkhan, Shixzamanli, Natavan, Mahsati and Sadilli.
Kapaz district (Kəpəz rayonu) was established on November 21, 1980 according to the decision of Supreme Soviet of Azerbaijan SSR. The district consists of 2 administrative territorial units and 6 administrative settlements. It has an area of approximately 70 square kilometers (27 sq mi) with the population of 178,000.
Nizami district (Nizami rayonu) was also established on November 21, 1980 according to the decision of Supreme Soviet of Azerbaijan SSR as Ganja raion of Kirovabad city. When Ganja's historic name was restored and the city was renamed as Ganja instead of Kirovabad in 1989, the district was also renamed as Nizami raion. The district consists of 2 administrative territorial units. The area of the district is roughly 39 square kilometers (15 sq mi) and population is 148,000.
Ganja is the second largest city of Azerbaijan after Baku with about 332,600 residents. The city is also inhabited by a large number of Azerbaijani refugees from Armenia and IDPs from the Azerbaijani community of Nagorno-Karabakh and surrounding areas. Their number was estimated to be 33,000 in 2011.
According to the State Statistics Committee, as of 2018, the population of city recorded 332,600 persons, which increased by 31,900 persons (about 10,6 persent) from 300,700 persons in 2000. 162,300 of total population are men, 170,300 are women. More than 26 percent of the population (about 86,500 persons) consists of young people and teenagers aged 14-29.
Population of the district by the year (at the beginning of the year, thsd. persons)
The economy of Ganja is partially agricultural, partially tourist based, with some industries in operation. Ore minerals extracted from nearby mines supply Ganja's metallurgical industries, which produces copper and alumina. There are porcelain, silk and footwear industries. Other industries process food, grapes and cotton from the surrounding farmlands.
The city has one of the largest textile conglomerates in Azerbaijan and is famous for a fabric named Ganja silk, which received the highest marks in the markets of neighboring countries and the Middle East.
People are mainly employed in manufacturing, education, transportation, service sectors and catering. “Det.Al-Aluminium” is the largest employer operating in Ganja, followed by Ganja Auto Plant and Ganja Winery Plant 2.
Traditional shops, modern shops and malls create a mixture of shopping opportunities in Ganja. Javad Khan Street is the traditional shopping street that is located in the old town. Constructed between 2014 and 2017,Ganja Mall is considered as the city's largest mall. Other shopping centers include Khamsa Park, Taghiyev Mall and Aura Park.
In 2016, Ganja was selected as the European Youth Capital by the final decision of international jury at the General Assembly of the European Youth Forum. Ganja became the first city to win the title of European Youth Capital among the former Commonwealth Independent States (CIS) and non-EU cities. It was an event with a budget of 5.7 million euros, projected to boost tourism by about one-fifth.
The city has many amenities that offer a wide range of cultural activities, drawing both from a rich local dramatic portfolio and an international repertoire. The city is known for its famous metal handicrafts industry during the Middle Ages. The most notable works of that period includes Gates of Ganja and Ancient Ganja Gate.
Other museums include Heydar Aliyev Museum, House Museum of Mir Jalal Pashayev, Memorial House-Museum of Nizami Ganjavi, Memorial-House Museum of İsrafil Mammadov, Ganja branch of Museum of Miniature Books, "Ganja Castle Gates - Archaeology and Ethnography Museum" monument complex, Cultural Center named after Mahsati Ganjavi, Museum of Modern Art and Museum of Mirza Shafi Vazeh.
Ganja State Art Gallery was established in April 1984 according to the decision of Council of Ministers of Azerbaijan SSR. The Gallery is headed by the carpet-artist Faig Osmanov.
Ganja is primarily known for its Azerbaijani and Islamic architecture, but its buildings reflect the various peoples and empires that have previously ruled the city. During Ganja Khanate period, the Khans proceeded to make an indelible impression on the skyline of Ganja, building towering mosques and houses from red bricks.
Bottle house in Ganja, a local icon entirely made of glass bottles
The two regional channels Kapaz TV and Alternativ TV are headquartered in Ganja. 2 newspapers are published in Ganja (“Gəncənin səsi” and “Novosti Qyandji”).
Ganja State Drama Theater
The building of the Ganja State Drama Theater was built by the German entrepreneur Christofor Forer in the 1880s. Ganja Drama Theater was established in 1921 in Baku as “Tənqid-təbliğ” (literally means “Criticism-propaganda”). In 1935 the theater moved to Ganja with its staff and continues its activity here under different names until 1990. The Theater has been called Ganja State Drama Theater since 1990.
Ganja has many well-maintained parks and gardens, with the Khan's garden being one of the most scenic parks, and one of the city's most known landmarks. It features interesting landscaping, and consists of a wide variety of trees and plants in an open concept.
Amphitheater in Ganja (2014)
Other prominent parks and gardens include Heydar Aliyev Park Complex, “Ganja 2016 European Youth Capital Park”, “Ganja river” park-boulevard complex, Istiglal Avenue, Fikrat Amirov Park, Fuzuli Park, and Narimanov Park.Heydar Aliyev park-complex includes an Amphitheater considered for organizing large outdoor events for up to 5000 people.
There are Olympic Sports Complex with 2 buildings (put into operation in 2002 and 2006 respectively), Ganja City Stadium with a capacity of 27000 put into use in 1964 and other sporting facilities in Ganja.
İn September 2017 “Ganja Marathon 2017” was organized involving 11000 people from different regions of Azerbaijan, as well as foreigners under the slogan “Be with us in the Marathon”. The race started from Triumphal Arch and finished at the Heydar Aliyev Park Complex covering a distance of 17 kilometers.
Ganja sits on one of the Azerbaijani primary rail lines running east–west connecting the capital, Baku, with the rest of the country. The Kars–Tbilisi–Baku railway runs along the line through the city. The railway provides both human transportation and transport of goods and commodities such as oil and gravel.
Ganja's Central Railway Station is the terminus for national and international rail links to the city. The Kars–Tbilisi–Baku railway, which directly connects Turkey, Georgia and Azerbaijan, began to be constructed in 2007 and completed in 2017. The completed branch connects Ganja with Tbilisi in Georgia, and from there trains continue to Akhalkalaki, and Kars in Turkey.
The first seminary in Azerbaijan aimed at professional training of school teachers was opened in Ganja in 1914 which was united with Girls Seminary in 1927 and renamed as Ganja Pedagogical Technical School (Azerbaijani: Gəncə Pedoqoji Texnikumu).
There are also schools offering secondary specialized education like Ganja Music College, Ganja Medicine College, Ganja State Regional Collage (established by combining Ganja Humanitarian Collage and Ganja Technical College in 2010).
There are a total of 7 schools offering vocational education in Ganja, being located as 3 vocational lyceums and a vocational school in Kapaz raion, a vocational lyceum and 2 vocational schools in Nizami raion.
^State Statistical Committee of the Republic of Azerbaijan, Official Publication: Statistical Yearbook of Azerbaijan 2018, Baku file:///C:/Users/user/AppData/Local/Temp/Rar$DIa0.183/stat-yearbook_2018.pdf
^Tucker, Spencer C., ed. (2010). A Global Chronology of Conflict: From the Ancient World to the Modern Middle East. ABC-CLIO. p. 1035. ISBN978-1851096725. January 1804. (...) Russo-Persian War. Russian invasion of Persia. (...) In January 1804 Russian forces under General Paul Tsitsianov (Sisianoff) invade Persia and storm the citadel of Ganjeh, beginning the Russo-Persian War (1804-1813).
^"13. Гянджа (Кировабад) (троллейбус)" [Vândža (Kirovabad) (trolleybus)]. Горэлектротранс (Electrotrans) website (in Russian). Дмитрий Зиновьев (Dmitry Zinoviev). Archived from the original on 31 January 2013. Retrieved 24 September 2012.