Flame licks the hills outside of this city on the Caspian Sea, spontaneous little eruptions jumping from the earth and testifying to the energy riches that this Muslim country with a large impoverished population is about to transform into billions of dollars in cold cash.

Between now and 2024, a new oil pipeline to Turkey will generate an estimated $124 billion, a bonanza for this nation of 8 million with a state budget this year of $1.4 billion.

Azerbaijan, a small former Soviet republic squeezed between Russia, Georgia, Armenia, Turkey and Iran, is on the verge of an oil boom. On Sunday it will go to the polls in parliamentary elections, and the outcome, amid charges of strong-arm tactics and fears of vote-rigging, might prove just as pivotal to the country's future.

A newly united opposition is challenging the near-complete hold on power of President Ilham Aliyev, who succeeded his father, a former KGB official, in 2003 after an election that was marred by violence and labeled fraudulent by Western observers. That has raised the prospect of fresh clashes after the parliamentary balloting.

The opposition has promised to take to the streets to protest any repeat of 2003 and attempt to galvanize the population into the kind of popular revolt that toppled governments in Georgia, Ukraine and Kyrgyzstan. Its resolve and ability to do so, which many have doubted, might have been strengthened by cracks within the president's circle, which became evident when he had some of his government ministers arrested on accusations that they plotted a coup last month.

Aliyev has been under pressure from the West, including a personal appeal from President Bush, to allow free and fair elections this time, and Aliyev has responded with a conflicting mixture of concessions and crackdowns, despite some opinion polls showing his party in a commanding position.

The results could test the Bush administration's commitment to promoting democracy, if an unacceptably tainted outcome favors U.S. commercial and strategic interests.

"We need the international community to be damning, completely damning, if this election is stolen," said Murad Gassanly, a British citizen of Azerbaijani origin who is advising the opposition, many members of which have taken to wearing orange ties and shirts to invoke the color used by the Ukrainian opposition before it swept to power. The opposition bloc believes it should win at least 40 seats in parliament out of 125, Gassanly said, but fears it will end up with as few as six, the number the bloc holds in the current legislature, which is dominated by the ruling party.

Government officials ridiculed the opposition's claims and said it simply doesn't have the political strength to take 40 seats. They refused to speculate about how many the opposition coalition could win.

Three opposition parties have formed a coalition called Azadliq, or Freedom, and are running a lone candidate in each of the country's 125 single-seat constituencies to maximize their potential. They have not, however, been able to form the kind of potent force that Viktor Yushchenko led in Ukraine, and they attribute that to government coercion and control of broadcast media, which is how the overwhelming majority of Azebaijanis receive their news. As international journalists arrived here this week, the government refused to allow in some satellite equipment, fearing the power of live pictures both to provoke and record protests.

"Without a vote being cast, the outcome has already been falsified," said Fuad Mustafayev, deputy chairman of the Popular Front Party, a member of the opposition coalition formed this year.

Mustafayev and others charge that their attempts to hold rallies and meet with voters have been met with baton-wielding police and almost daily harassment. The Parliamentary Assembly of the Council of Europe criticized the government for "disproportionate violence and brutality, bordering on outright cruelty."

Members of the president's ruling New Azerbaijan Party reject the criticism and argue that the police broke up illegal rallies and acted violently usually when they were attacked first -- a claim contrary to numerous eyewitness accounts from journalists and Western election monitors.

"The opposition has had all possible freedom, but it does not have the right to break the law and hold rallies without permits," said Ali Ahmadov, a member of parliament and deputy chairman of the ruling party. "We listen to the criticism, and we've agreed with some of it and responded."

The government has agreed to mark the fingers of voters with ink to prevent multiple voting, and it has opened voter lists to public scrutiny. An exit poll underwritten by the United States is intended to serve as a check on results produced by the Central Elections Commission. Any serious divergence between the poll and the official results, as happened in Ukraine, will serve as a trigger for demonstrations, opposition leaders said.

The harassment of the opposition has continued into the eve of elections. An exiled U.S.-based opposition leader, Rasul Guliyev, is on the ballot. His campaign manager here was detained by police late this week. The arrest followed government charges that Guliyev was planning a coup in collusion with a number of people in the president's circle. The economic development minister, Farhad Aliyev, who is no relation to the president, and Health Minister Ali Isanov, among others, were arrested, charged with plotting to overthrow the government, and fired.

"They all confessed," Ahmadov said.

In the last week, the number of people running in all 125 constituencies dropped from more than 2,000 to 1,544 as candidates associated with the arrested ministers dropped out of the race. Their withdrawal was described as "voluntary" by officials in the ruling party.