As voters in Azerbaijan go to the polls Nov. 6, they will do more than choose a new parliament. They will participate in an election whose conduct, for better or worse, will serve as a referendum on U.S. efforts to spread democracy through the world.

A free and fair election will send a message that Islam, oil and democracy can go together. A rigged or tainted vote, conversely, will affirm that those elements do not mix well -- and perhaps show that the West, particularly the U.S., is indifferent to democracy when oil and military bases are at stake.

Azerbaijan is, in many ways, perfectly primed for such a test. It is an oil-rich country whose population is overwhelmingly Muslim, yet it has a rich liberal legacy predating Soviet communism. Azerbaijan opened the Muslim world's first Islamic school for girls in 1901 and its first opera in 1906. It became the region's first democratic republic in 1918. Azerbaijan also enjoys a high literacy rate, a growing middle class and no substantial extremist Islamic movements.

Yet the current regime is not without blemishes. In the decade after communism collapsed, rulers in the former Soviet republics frequently rigged elections to stay in power. Azerbaijan was no exception.

President Ilham Aliyev assumed power in a fraudulent election two years ago after the illness of his father, longtime strongman Heydar Aliyev. Opposition forces protested. In Baku, the capital, demonstrations turned violent, and the government quickly ended them. Since then, the surrounding region has changed dramatically in favor of democracy. The Rose Revolution in Georgia ousted semi-autocratic President Eduard A. Shevardnadze in 2003. The following year, Ukraine's Orange Revolution toppled the regime of President Leonid D. Kuchma. A few months later, in March 2005, President Askar A. Akayev suffered a similar fate in Kyrgyzstan's Tulip Revolution.

Against that backdrop, Aliyev's government has taken several steps -- positive and negative -- to avoid revolution in his country. Aliyev has made election reforms that include publishing a voter registry and ceasing the disqualification of opposition candidates.

The government, however, also made several anti-democratic moves, including preparing to jail former President Ayaz Mutalibov and former parliament speaker Rasul Guliyev if they return to the country and participate in the elections. Aliyev's government has denied opposition parties access to the main square in Baku for campaign rallies, has kept them out of public buildings for events and has all but shut them out of national television.

Public opinion polls suggest that Aliyev's party would probably win a majority of seats in a free and fair election, but the young leader lacks the confidence to allow fair balloting. Officials who rigged the last election have not been replaced, and the government has refused to follow the Iraqi example of marking voters' fingers with ink to prevent multiple trips to the polls. Aliyev's party changed the electoral law to make it more difficult to uncover false balloting through the usual means of parallel-vote tabulation or exit polls. To date, Aliyev has not allowed the National Democratic Institute -- an American nongovernmental organization recognized around the world as a premier election-monitoring organization -- to observe the vote count.

The government also has arrested leaders of an Azerbaijani student organization modeled after similar youth movements that played vital roles in protests elsewhere in the region. The charge: plotting an armed insurrection.

President Bush has done little to try to influence the process. On the contrary, the message from Washington is confused, which only encourages the bad guys in this latest frontier in the worldwide struggle for freedom.

Azerbaijani opposition leaders vigorously embraced Bush's second inaugural address, which underscored his commitment to promoting liberty. Yet these same Azerbaijani democrats lamented the counter-signals sent by the visit of Defense Secretary Donald H. Rumsfeld last spring, which, according to news accounts, had everything to do with securing a new military base for U.S. forces in the region.

Other Bush administration officials focus on Azerbaijan's oil exports to the West, ignoring recognition of the role that the country could play as an example of Muslim democracy. Bush and his foreign policy team must now make U.S. priorities and principles clear, especially because Aliyev is eager for Washington's embrace.

Since becoming president, Aliyev has desperately sought an invitation to the White House as a way to gain legitimacy and help in his political struggle against the old guard in his government and party.

Bush should make a private offer of an invitation to Washington if the election is free and fair. He should also pressure Azerbaijani opposition leaders, urging them to refrain from violence regardless of the election outcome. Rioting would discredit them, while peaceful resistance would strengthen their cause.

Finally, Bush must send a senior U.S. official to observe the election. Last fall, Bush wisely sent Sen. Richard G. Lugar (R-Ind.) to Ukraine. By denouncing the election fraud he witnessed, Lugar put the United States on the side of fair elections in the standoff that ensued. If push comes to shove in Azerbaijan next month, we should be on the right side -- the democratic side -- again.