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”. Khazr is believed to be a corrupted form of the name of “Khaled”, while “Patgos” stands for Persian “patgospan”, i.e. governor. Arshakashen (Armenian: Արշակաշեն, meaning "built by Arshak") was one of the cantons of the province of Utik, which was part of Armenia, before 387 AD, and of Caucasian Albania after the division of the Kingdom of Armenia between Persia and Byzantium.
However, modern historians believe that the Persian name Ganja (گنجه / Ganjeh, "Ganja" derives from the New Persian ganj (گنج: "treasure, treasury")) suggests that the city existed in pre-Islamic times and was likely founded in the fifth century A.D.. The area in which there was Ganja, during the 9th to 12th century named Arran; its urban population spoke mainly in the Persian language.
Most experts believe that the best the etymology of "Ganja", (گنجه, گنجه Ganja / Ganjeh) that it refers to the Persian word of ganj گنج which means treasure, or treasury. There are several other places in Iran and the wider region wich has a similar name as Ganja.
Historically an important city of the South Caucasus, Ganja has been part of Sassanid empire, Great Seljuk Empire, Atabegs of Azerbaijan, Khwarezmid Empire, Il-Khans , Timurids , Jalayirids, Qara Qoyunlu, Ak Koyunlu
, and the Ganja Khanate. Ganja is also the birthplace of the famous poet Nizami. The people of Ganja experienced a temporary cultural decline after an earthquake in 1139 and again after the Mongol invasion in 1231. The city was revived after the Safavids came to power. She was also managed by Ottomans between 1578-1603 and 1724-1735. For a short period, Ganja was renamed Abbasabad by Shah Abbas after war against the Ottomans.He build a new city 8 km 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 (Ganja) beylerbey, one of the four such administrative units and principalities. In 1747, Ganja became the center of the Ganja Khanate.
According to the October 1813 Gulistan Treaty, the Ganja Khanate, together with most of Azerbaijan and Georgia, was recognized as part of Russian Empire after Persia's defeat in the Persia-Russia wars. It was renamed Elizavetpol (Russian: Елизаветполь) after the wife of Alexander I of Russia, Elizabeth, and in 1868 became the capital of Elizavetpol Governorate.. Elizavetpol was a uyezd of Tiflis Governorate before 1868.
In 1918, Ganja became the temporary capital of the Azerbaijan Democratic Republic, at which point it was renamed Ganja again, until Baku was recaptured from the British backed Centrocaspian Dictatorship. In April 1920, the Red Army occupied Azerbaijan. In May 1920, Ganja was the scene of an abortive anti-Soviet rebellion during which the town was heavily damaged by fighting between the insurgents and the Red Army. In 1935, Joseph Stalin renamed the city Kirovabad after Sergei Kirov. In 1991, Azerbaijan re-established its independence, and the ancient name of the city was given back.
Today Ganja is the second largest city in Azerbaijan.
According to the official government data, at the beginning of 2006, the population of Ganja was 305,600. It has an international airport, and is home to the Nizami Mausoleum, re-built in 1991.
The city's historically important Christian figures include Kirakos Gandzaketsi (Կիրակոս Գանձակեցի, 1201-1271, author of the History of the Armenians ), Armenian philosopher Mkhitar Gosh (Մխիթար Գոշ, c. 1130–1213) author of the Code of Laws that was used in Armenia, Armenian Kingdom of Cilicia and Armenian diasporan groups in Europe , and Grigor Paron-Ter (Գրիգոր Պարոն Տեր, 1560-1645) - Armenian Patriarch of Jerusalem. Among the modern time's prominent Armenian person's of the city were Russian-Armenian architect Karo Halabyan , secretary of Armenian SSR communist party, President Askanaz Mravyan , Marshall Hovhannes Baghramyan , Chief Marshal Hamazasp Babadzhanian and the Olympic champion Albert Azaryan .
About 99% of the population of Ganja speak Azerbaijani, only 1% of the population speak in other languages.