The war in Georgia created new dilemmas for its oil-rich neighbor Azerbaijan, which has walked a tightrope between Moscow and Washington while dealing with a simmering ethnic conflict of its own.
Azerbaijani President Ilham Aliyev, almost certain to be re-elected for a second term Wednesday, has so far managed to maintain good relations with Georgia, Russia and the U.S.
His country is part of GUAM, a group of Western-leaning ex-Soviet republics that brings together Georgia, Ukraine and Moldova and is designed to counter Moscow's influence in the region.
But he hasn't taken a firm stand on August's war between Russia and Georgia or Moscow's controversial recognition of two separatist Georgian regions, Abkhazia and South Ossetia, as independent states.
The issue is sensitive because Azerbaijan has its own rebel region: Nagorny Karabakh, a mountainous, ethnically Armenian enclave that Baku has sought to regain ever since it broke free in a bloody war in the early 1990s.
Aided by a steady flow of petrodollars, Aliyev, who has ruled since 2003, can afford to follow a measured and independent foreign policy, analysts said.
"The war in Georgia has shown that this prudent policy with regard to both Russia and the West was good," said Rasim Musabayov, a Baku-based political analyst.
But experts say Aliyev has received warnings, like the Russian bombs that fell in August near the Baku-Tbilisi-Ceyhan oil pipeline, a project dear to Washington because it bypasses Russia.
The fate of BTC and the planned Nabucco gas pipeline, which would also bypass Russia to link the Caspian region to Europe, was the focus of U.S. Vice President Dick Cheney's visit to Azerbaijan in September.
Moscow, which backs the rival South Stream pipeline network, views Nabucco as a "major risk for existing projects," said Musabayov, who didn't rule out "an attack on BTC" as a possible Russian response.
Russia and the West were vying for access to Azerbaijan's energy resources well before the war, with Russian gas giant OAO Gazprom (GAZP.RS) offering to buy Azerbaijani gas at market prices in June to prevent it from going to a western buyer.
An adviser to President Aliyev, Ali Hasanov, said Baku was in no hurry to choose sides.
"For the moment, we are fine. When we need to choose, we will. We have received proposals, we have to think," he said.
Alexei Malashenko, a Caucasus specialist from the U.S.-funded Carnegie Moscow Center, said Aliyev had "haggled well with Moscow to reinforce his position.
"Without clashing with Moscow, and with a smile, he will continue the policy of building pipelines that bypass Russia," said Malashenko.
Sabit Baghirov, a former president of Azerbaijani state oil company SOCAR, agreed Baku would continue cooperating with the West despite Russia's rout of Georgia.
"The Russian ambassador in Baku said countries in the region should learn from events in Georgia. What did Russia get in Georgia, who has she scared?" Baghirov said. "There are many people in Azerbaijan who have grown up with Russian culture, but politics is another thing."
He said, however, Azerbaijan would now be more cautious in its policy towards Nagorny Karabakh, whose separatist administration is backed by Armenia, Russia's main ally in the Caucasus.
"President Aliyev has stopped saying he could use force" to retake the region, he said.
Hasanov, the presidential aide, said he hoped the Georgian crisis would push the world's major powers to work more actively to resolve the Nagorny Karabakh conflict.
"Until now, this issue was at the bottom of the list of their priorities," he said.