Tsar Russia period
Great games and Russian rule
By 1807, only Nakhchivan remained an independent khanate. However weakened by the Napoleonic wars, the Russian grip on the Caucasus took a long time to tighten. The British, initial tacit supporters of Russia as a counterbalance to France and their Ottoman allies, started getting nervous at Russia's expanded empire and possible threats to India. Britain began helping the Ottomans to arm bands of Caucasus mountain resistance fighters such as Shamil while Persia used the opportunity to try at grabbing Azerbaijan back again. After initial successes aided by pop-ular support (eg in Ganja), the Persians were unceremoniously ejected again and were forced to sign the 1828 Treaty of Turkmenchay which formally recognized the permanent division of Azerbaijan.
The consolidation of Russian rule caused some important demographic changes - notably the mass influx of Armenians into Azeri lands such as Karabagh and Zangezur, where they felt safer than in the Muslim Ottoman or Persian empires. This was eventually to sow the seeds of the Karabagh war. Russian colonization took off relatively slowly as the region was seen as a hardship posting and place of exile. The economy was not aided by redistributing many of the feudal lands to Russian military officers and disinterested nobles so, to improve matters, hard-working German migrants from impoverished states such as Wurtemburg were bribed to settle the area. Nonetheless, the Europeanization of Azerbaijan had an important effect in tempering local Islam, and making the Azeris an important cultural bridge for an interchange of ideas between the west, Ottoman Turkey and Iran.
Russia took several decades to stabilize the region militarily and even then was slow to appreciate the potential of Baku oil. A state monopoly did little to garner investment as private individuals were at best allowed to lease land for two-year periods which was rarely sufficient to repay investment in refining or transportation infrastructure.
Everything changed in 1872 when the industry was denationalized. The invention of the motor car and development of refining methods meant that in 30 years production soared from 63 to 32,000 tons per day. In the first years of the 20th century half the entire world's production was supplied from Baku. Famous names including Rothschild, the Nobel brothers and HZ Tagiyev contributed to harnessing the profits into a major economic boom and transforming Baku from a sleepy port town of 5000 souls into a burgeoning metropolis. Many of the traders, investors and workers who arrived to swell the population were not native Azeris at all but Russians, Europeans, Persians, Armenians and Jews. By the turn of the 20th century Baku was a highly cosmopolitan city but despite several rags to riches tales of Azeris striking oil, most of the wealth remained in the hands of foreign companies and investors.
While Baku's elite were attending the new opera house or giving musical soirees in their grand new stone mansions (that still beautify the city centre), workers suffered appalling conditions. Not only did labourers have to wallow in poisonous petroleum while hand digging wells but the powerful companies could and did interfere in the personal lives of their workers. The Caspian Oil Co even forbade marriage without company permission. Thus Baku became a hotbed for Bolshevik agitators and oilfield strikes set the scene for the abortive first Russian revolution of 1905.
Massacres and provocation
The ethnic mixture of Baku at the turn of the 20th century was very complex. The Azeri population (Tatars' according to the disdainful appellation of the day) had become a minority in their own city and did many of the worst manual jobs. Tensions especially between poor Tatars and nou-veau-riche Armenians were simmering even then, but the massacres on 'Black/ Bloody Sunday' (Jan 22nd 1905) were deliberately provoked.
To prevent a united revolutionary movement emerging in the notoriously independent-minded Caucasus, the Russian government set out to confuse and destabilize the region. They were prepared to burn the oilfields rather than allow them to fund an opposition movement. The Black Hundreds', a series of government-recruited gangs, deliberately killed Armenians and blamed Tatars, killed Tatars blaming Armenians and set children of one community against one another inciting their parents to fight. This successfully ignited one of the worst inter-racial massacres ever recorded. The blatant use of agents provocateurs was to prove a useful lesson to Russian governments in future moments of crisis at home - in 1918 and 1988-90. On both occasions the Caucasus dissolved into civil war and popular opinion was persuaded to blame the maligned Muslims.
Once the ash had settled and the corpses had been buried, Baku still managed to retain a degree of revolutionary fervour out of proportion with the waning revolution elsewhere. In Russia communists were effectively defeated by a 1907 coup d'etat. But at this time in Baku, the workers continued to elect Bolshevik representatives. These efforts led to very little in the long term, but proved historically pivotal in hindsight. Leading the movement was a shadowy figure using the pseudonym Gayoz Nisharadze. Nisharadze's tenacity caught the eye of an almost despairing Lenin and thus began the long rise to infamy of the man who later rebranded himself as Stalin.
World War I
The events leading to Azerbaijan's independence in 1918 are fascinatingly complex. In 1917 Russia collapsed into civil war. Lenin dashed back to St Petersburg passing secretly through enemy German territory on a sealed train from Paris, and once in control of Russia simply gave up on WWI (Brest Litovsk Treaty, 3 March 1918). Azerbaijan, Armenia and Georgia initially formed the short-lived Trans-Caucasian Federation.
Meanwhile, a team of Bolshevik commissars under the much-reviled Stepan Shaumian, arrived in newly 'liberated' Baku to nationalize the oil industry on behalf of the Bolsheviks. The Baku 'commune' fearing ethnic Azeris to be 'anti-rev-olutionary' did little to stop the street fights which snowballed into wide-scale inter-ethnic conflict resulting in the massacre of an estimated 12,000 Azeris. The so-called 'March Days' saw the burning of much of the city and brought the oil business to a virtual standstill (see '26 Commissars').
Meanwhile WWI was reaching a climax. Enver Pasha's Turkish 'Army of Islam' was storming towards the Caucasus, ostensibly promising aid to their ethnic Azeri kin but doubtless also to advance their teritorial ambitions. However, they ended up squabbling with their supposed allies (the Germans) who the Georgians had invited in as the better of two evils. They feared an Armenian-style massacre if the Turks arrived first.
Thus the Turks fought their way towards Azerbaijan through northern Iran, harned by a pathetically small force of British troops working secretly in the pay of the Shah of Persia.
The ethnic Azeris welcomed the arrival of the Turks wholeheartedly. Azerbaijan had declared its independence from the Trans-Caucasian Federation on 28 May 1918 and set up an independent Azeri Parliament in Ganja (the building still stands). The Turks reached Ganja on 20 June and many Azeri patriots joined their Army of Islam's march on Baku. Meanwhile a bizarre coalition of mutually-loathing forces put aside their differences to prepare Baku's 'defence'. Communists, Armenian Dashnak nationalists, pro-Tsarist Russian Cossacks under General Bichkarov and, arriving nght at the last minute, the British 'Dunsterforce'.
The climax, as if written by a hammy movie mogul, came melodramatically slowly. As if waiting for the director's cue the Turks delayed their final assault just long enough to allow numerous additional defenders to arrive in the nick of time. Nonetheless the city fell on 15 September. The 'brave' British defenders had requisitioned a steamer and quietly slipped out of port the night before. For three days much of the Armenian population was massacred in belated revenge for the March Days.
The Turks had over-reached themselves, however. Their supply lines were cut by Allenby and his British Palestine force and on 30 October they were forced to sign a humiliating armistice, handing back Batumi (Georgia) and Baku to Allied (but in practice British) peacekeeping troops.