In the 19th century this part of the Russian empire experienced an unprecedented oil boom which attracted international investment. By the beginning of the 20th century Azerbaijan was supplying almost half of the world's oil.
In 1994 Azerbaijan signed an oil contract worth $7.4bn with a Western consortium. Since then Western companies have invested millions in the development of the country's oil and gas reserves. However, the economy as a whole has not benefited as much as it might have done.
Caspian oil is now flowing through a pipeline running from Baku through Georgia to the Turkish port of Ceyhan, providing western countries with ready access to a vast new source of supply. Environmental groups have protested that the cost of this benefit is unacceptable.
Azerbaijan has large gas reserves too.
Azerbaijan became a member of the Council of Europe in 2001. Often accused of rampant corruption and election-rigging, ruling circles walk a tightrope between Russian and Western regional geo-strategic interests.
As the Soviet Union collapsed, the predominantly Armenian population of the Nagorno-Karabakh region stated their intention to secede from Azerbaijan. War broke out. Backed by troops and resources from Armenia proper, the Armenians of Karabakh took control of the region and surrounding territory.
In 1994 a ceasefire was signed. About one-seventh of Azerbaijan's territory remains occupied, while 800,000 refugees and internally displaced persons are scattered around the country.
Azerbaijan was in the media spotlight in June 2007 when Russian President Vladimir Putin offered the US the use of the Gabala radar station for missile defence as an alternative to using bases in Poland and the Czech Republic.
President: Ilham Aliyev
Ilham Aliyev took over as president from his father, Heydar, in 2003.
Heydar Aliyev described his son as his "political successor". When his father died, Ilham was already prime minister, vice chairman of the state oil company and deputy leader of the ruling New Azerbaijan Party (NAP).
He won the 2003 presidential elections by a landslide. Western observers were highly critical of the campaign which they said had been marred by voter intimidation, violence and media bias. Opposition demonstrations were met with police violence. There were many arrests.
Heydar Aliyev, a former Soviet Communist leader, reinvented himself as a post-independence political strongman and had ruled Azerbaijan with an iron fist since 1993 following a period of great instability. His record on human rights and media freedom was often criticised in the West.
The opposition has strong doubts about Ilham Aliyev's commitment to democracy.
These were reinforced when police used force to break up opposition demonstrations in Baku in befire November 2005 parliamentary elections in which the ruling NAP won well over half of the seats. EU and OSCE observers said the process fell far short of international standards.
Mr Aliyev won a second term of office in 2008, scoring an overwhelming victory in an election that was boycotted by the main opposition parties. Western observers said that, despite being an improvement on previous votes, it fell short of fully democratic standards.
He looked set to cement his grip on power even further when a move to lift the two-term limit on the president was approved in a referendum in March 2009, paving the way for a possible third term.
In November 2010, the ruling NAP increased its already healthy majority in parliamentary elections, with the main opposition party failing to win a single seats. International observers again criticised the vote.
Ilham Aliyev was born in 1961 and has a doctorate in history. His business interests have enabled him to build substantial personal wealth since independence. He is married with three children.
Azerbaijan's state-run and public media compete with private and opposition publications and broadcasters. TV is the most-popular medium. A public broadcaster, set up in 2005, is intended to be free from government control.
Freedom of speech is guaranteed by the constitution, but in 2010 Reporters Without Borders (RSF) said journalists and bloggers "work in a climate of endemic impunity and under persistent pressure from the authorities". State influence over broadcast media "stifles diversity", it added.
Local relays of the BBC and US international radios were closed in late 2008 by the broadcasting regulator.
Turkey's state-run TRT TV is rebroadcast in Azerbaijan. Iranian and Russian channels can be seen in border areas.
There were 3.7 million internet users by June 2010 (InternetWorldStats). In 2010, RSF said it found evidence of a "vibrant and growing" online media, but criticised the government for failing to provide citizens with affordable, high-speed internet access.