The city derives its name from Dzhanzar (Arabic for 'Treasury/Harvest store'). Or according to some sources, from a long forgotten Gandjak tribe that once built primitive huts in the area. Like all cities of the region it has been repeatedly flattened initially by the Persians in the 7th century and by Arabs soon after.
The city's first period of pre-eminence came with the weakening of the Arab caliphate in the mid-10th century when Ganja developed its semi-independent Salarid dynasty, succeeded by the Shadadids who built fortresses, bridges and caravansarais to underline the town's importance on intercontinental trade routes.
Though partially Islamicized, Ganja remained a centre of Christianity - the seat of the Albanian Catholicos until 1054 when the city fell to the Seljuk Turks under Togrul 1. Seljuk rule did not interfere with the city's growth and in 1063 the khan's builder Ibragim Ganjavi constructed the celebrated Ganja gate. This was partially ruined in a massive 1139 earthquake. The remnants were seized by a Georgian raiding party and taken to Gelati monastery near Kutaisi where its stones now form the King David gate.
With Seljuk power weakening, the regional governor Shamsaddin Eldegyz ran the Ganja-based region ('Atabeys') as an autonomous state. Although the power centre shifted for a while to Nakhchivan, Ganja flowered as the cultural capital during an unprecedented golden age. Famed for liberal multiculturalism the city fostered Azerbaijan's greatest classical poet, Nizami Ganjavi, as well as the gifted poetess Mehseti Ganjavi. The golden age collapsed along with the state of Atabeys with the Mongol invasions. Though the first raid in 1220 failed, the city fell in 1225 to Jalaladdin. the Turkoman-Mongol ruler of the expanding Khorazem sultanate (centred on what is today's western Uzbekistan). Plucky Ganja did not give up without a fight. In 1231, a peasant-and-craftsman's revolt led by the unfortunately named 'Bender', destroyed Jalaladdin's governor's palace and killed his servants. The rebels redistributed money and jewels to the poor. Inevitably Jalaladdin was not a happy Sultan. His troops returned and gruesomely beheaded poor Bender. But no sooner had they restored 'order' than the 'real' Mongols arrived. The city was pillaged and left in lifeless ashes for four years before limping back into existence.
Hulugu Khan, the Mongol-Persian Il Khan emperor (reigned 1256-65), incorporated the region into his slice of empire ruled from Soltaniyeh in today's Iran. Ganja became a major link in the Il-khannid defensive ring but couldn't stand up to Timur, who stormed through a century later. Timur not only sacked the city but expelled most of the native population to central Asia, replacing them with thousands of captured Syrian families.
For several subsequent centuries, the region returned to a mostly Persian orbit. Eclipsed culturally by Tabriz, Ganja nonetheless rebounded yet again as a trade and Islamic centre with an important mosque built by Shah Abbas (still standing). 'Verily its one of the fairest cities in all Persia' gushed Polish traveller Cornelius DeBruin in 1718 admiring the 'wide streets, large caravansarais, a river through the town and all surrounded by gardens and orchards'. The positive impression reinforces Philippe Avrille's 1681 nickname 'paradise garden' for a Ganja which he found to be surprisingly bustling with foreigners.
By the 18th century, Ganja was 'the principal centre of Islam in the Caucasus , and an independent khanate despite being briefly absorbed into King Irakli's Christian Georgia. In 1795 the city fell to Aga Muhammad, founder of the ruthless Persian Qajar dynasty. British diplomacy restored the local Khan Javad to the throne but after a fierce struggle the city was grabbed for Russia by Viceroy Tsitsianov in 1804. The battle is depicted in a huge painting in Baku's Historical Museum. Russian rule was by no means popular and in 1826 Ganja opened its gates to the Persian forces of Abbas Mirza. But the Tsar's forces counter attacked and the permanent division of Azerbaijan into Russian north and Persian south was settled two years later by the Treaty of Turkmenchai.
Ganja's centre of gravity shifted several kilometres west towards the massive pentagonal star-shaped fortress (originally built in 1588 - a small fragment of wall remains in what is now the central park) around which Russian colonial buildings were built. Re-christened Elisavetspol for Tsar Alexander I's wife, the town's population was just over 20,000 in 1905, according to Gulbenkian. In 1918, the town became Ganja again and was capital of the Azerbaijan Democratic Republic, until Baku was reclaimed from the Bolshevik commissars. In Soviet days the town was renamed Kirovabad and became a sprawling semi-industrial city. It regained the name Ganja in 1991 though most Azeri inhabitants had never called it anything else.
1918 - Ganja leads the Islamic world to democracy
In the confused months concluding WWI, Tsarist Russia had collapsed and communists had seized Baku and were being supported by a bizarre triad of mutually-loathing Cossack, British and Armenian forces. The three Caucasus nations Azerbaijan, Georgia and Armenia, were in an unstable TransCaucasian Federation. As the Ottoman Turkish army marched east, the federation fell apart, Georgia declared independence and two days later on 28 May the Azeris followed suit.
The Azerbaijan Democratic Republic (ADR) declared by the Tatar National Council in Ganja welcomed the impending invasion by their Turkish 'ethnic brothers'. The Turks arrived in Ganja on 20 June and were joined by some 10-12,000 Azeri volunteers who formed the 'Army of Islam' to march on Baku under Ottoman commander Nuri Pasha.
Meanwhile, Ganja had become the capital of the world's first democratic Islamic nation. De facto ministries were set up in the homes of activists while the city council office (later used as a WWII hospital and now the agricultural academy) became the ADR's parliament. It held its first session at 2pm on 17 June. As yet 'democracy was an abstract principle as no national vote had been able to confirm the leadership. Nonetheless, the leaders were later to impress US President Woodrow Wilson with their advanced, principled philosophy.
If you're planning a trip to Azerbaijan you may be interested ▶ Azerbaijan highlights - For those who prefer to go unbeaten path, to explore less visited places and check national charisma of this small country in Southern Caucasus on the edge of Europe.