In this village 45 kilometers outside Baku, the capital's boulevards crammed with boutiques give way to a labyrinth of winding, dusty streets. Instead of billboards advertising Gucci fashions or SUVs, there are political slogans daubed in paint on the village's sandstone walls, some praising Ayatollah Khomeini, others proclaiming "Death To America and Israel."
In the local mosque, an imam from Iran preaches. The men sit cross-legged and listen, the wind whipping through a tarpaulin separating the men's side from the women's.
"Azerbaijan and Iran have been brothers for ages," the imam says. "They are sisters, they are one house. They have the same blood, same language, same faith. There is no difference between them."
Iran and Azerbaijan both have majority Shi'a populations, and at least 25 percent of Iran's population is ethnic Azeri. But cultural and ethnic similarities aside, there is much that divides the two countries.
One is a largely secular, post-Soviet state eager to use its energy wealth to secure powerful friends in both the West and the East. The other is a repressive Islamic society whose combative policies have left it almost completely isolated from Europe and the United States.
Still, the relationship between Baku and Tehran is considered a critical linchpin in the vital, and volatile, Caspian region. Links between the two have come under the spotlight in recent weeks, with the trial and ultimate conviction of 15 Azerbaijani men found guilty of passing information on Western embassies and companies operating in Azerbaijan to Iranian intelligence.
The closed-door trial, which opened in Baku in early October, concluded on December 10, with the country's Court for Serious Crimes convicting the defendants on charges of treason and sedition.
The defendants, all members of Nima, a small Islamist group, were found guilty of cooperating with Iranian special services in plotting a coup against the government of President Ilham Aliyev. The group's leader, a young cleric who staunchly denied any ties to Iranian intelligence, received 14 years in prison.
Iran expressed deep anger over the verdict and the accusations, by extension, that it sought to destabilize the Azerbaijani government. Officials in Tehran summoned Azerbaijan's ambassador to the Foreign Ministry and called the court proceedings a "comedy."
But in Azerbaijan, the verdict is a serious reflection of official worries about the encroachment of Iran's political brand of Shi'ite Islam. Officially secular Azerbaijan has seen a growth in Islamic faith since the breakup of the Soviet Union, fueled by money and missionaries sent by foreign groups.
In the early 1990s, it was common for Iranian imams to be preaching in Azerbaijani mosques. Azerbaijani authorities have since sought to rein that in, tightening controls on religious education.
But Yadigar Sadigov, the local head of the opposition Musavat party in the southeastern town of Lankoran close to the Iranian border, says that Iran's radical version of Islam is still making inroads into religious life in the town.
Sadigov says that Iran broadcasts Azeri-language religious programs into Azerbaijan; Lankoran bookshops are full of ideological works from Iran. "The propaganda promotes the Islamic regime in Iran and says that our secular system is not good," Sadigov says.
Alimardan Aliyev, the local mayor's spokesman, denies that Islam is making inroads in the region. "This region doesn't have a problem with extremism, especially Iranian-sponsored extremism," he says. "You won't find an Iranian speaking in our mosques."
Many observers see relations between the two countries worsening -- and say that it's a growing economic rivalry, rather than religion, that's to blame.
Steve LeVine, a former "Wall Street Journal" correspondent and the author of a recent book on Caspian oil, "The Oil and the Glory," says that there is no brotherly love between Iran and Azerbaijan.
"There is a rivalry of sorts involving oil. Iran is putting its oil on the Gulf and Azerbaijan is putting its oil onto the Mediterranean and they're headed for the same market," LeVine says.
Underscoring the economic rivalry is the ongoing dispute over the delimitation of the Caspian Sea.
The dispute centers on whether the Caspian is classified as a sea or a lake, which affects the littoral states' claims on its resources.
Russia, Kazakhstan, and Azerbaijan have all signed bilateral agreements about their sectors, but Iran still insists on a multilateral agreement among all five states, including Turkmenistan.
LeVine says that Russia and Iran are allies in the strategy of thwarting a Caspian resolution "in order to stop any trans-Caspian pipeline," in particular a pipeline that would ship oil from Central Asia to the Mediterranean, via Azerbaijan.
The rivalry between Azerbaijan and Iran is increasingly being sharpened by an anti-Western axis of Russia, Armenia, and Iran.
Federico Bordonaro, a Rome-based senior analyst with the "Power and Interest News Report," says that a Russian-Armenian-Iranian strategic partnership is very profitable for Russia if Moscow is to check the U.S. and NATO penetration in the South Caucasus. Such an axis, he says, also works for Iran.
"Iran does not want a very strong Azerbaijan -- first of all, because Azerbaijan is pro-United States, and second, because the Azeri minority in Iran must be checked by the Tehran central government," Bordonaro says.
The alliance between Muslim Iran and Orthodox Armenia and Russia -- at the expense of predominantly Muslim Azerbaijan -- is testament to how geostrategic and economic interests tend to override religious or cultural ties in the region.
What isn't clear is whether Azerbaijan's and Iran's economic rivalry will be characterized more in the future by accusations of skullduggery and worsening relations.
'Everything Could Be Here'
In the past, Azerbaijan has tried to play a skillful balancing act between Moscow, Washington, and Tehran, and has been careful to maintain friendly relations with its large southern neighbor.
Baku faced a profound diplomatic challenge this year when Russia offered an Azerbaijani radar base to the United States for use in an antimissile program aimed squarely at Iran. But the potentially divisive proposal appears to have stirred only minor ripples.
Ahmadinejad and Aliyev pledged continued cooperation at friendly talks in Azerbaijan in August, just weeks before U.S. and Russian officials were scheduled to inspect the radar facility in Qabala.
More troublesome, it seems, is the question of Iranian meddling in Azerbaijan's state security. Azerbaijani officials have recently said that there are other terrorist groups at large.
Vafa Guluzade, a former adviser to late Azerbaijani President Heydar Aliyev, says he is 100-percent convinced that Iran has a good intelligence network operating in Azerbaijan.
"This network can work to destabilize the situation: explosions, suicide bombers, I don't know, everything could be here," he says.
Perhaps more worrying for the Azerbaijani authorities is popular sympathy for the Iranian regime.
In towns close to the Iranian border, there is a large population of Talysh, who are linguistically and ethnically similar to Persians. Many locals regularly travel across the border to visit their ethnic Azeri relatives in northern Iran and sell food and clothes.
There is also growing disenchantment in Azerbaijan with the regime of Ilham Aliyev, which is viewed by many as deeply corrupt and antidemocratic. Yadigar Sadigov, the opposition party head in Langkoran, says that dissatisfaction at home could easily create ears receptive to Iranian propaganda.
"In the first years of independence, people supported the secular system, democracy, but the government didn't keep its promise," he says. "They are not optimistic about democracy and the secular system -- and then people will orientate themselves to the Iranian side."