Astara doesn’t scream so much as strongly hint at the possibility of sin. Next to the customs terminal’s courtyard and above the row of babushkas selling tea and beef kebabs, there’s a convenient motel (“Ideal for bringing the girls back to,” one Iranian told me). The fluorescent-lit cafés on Aliyarbeyov Street are stocked with Russian vodka and French cognac, and the Turkish Salon, on Fountain Square, offers, among other things, tattoos, piercings, astrological forecasts, and “full-body massage.”

All of this is made possible by the Azerbaijanis’ somewhat attenuated relationship with God, the product of seven decades of Communist rule and a steady influx of Westerners after oil was discovered in the mid-1800s. Iranians find the Azerbaijanis’ mildly ironic attitude toward Islam a welcome relief from the stern theocracy of the ayatollahs. During Ramadan many Azerbaijanis do not fast, and the cafés in Astara do a bustling lunch business, serving lamb shashlik, or barbecue, to visiting Iranians. Manana Shafieva, a stylist at the Turkish Salon, said many Iranian men bring in their wives to be spruced up. “They say, ‘I know she can be beautiful. Can you make her beautiful?’ They know we know about hair and what it means to have a modern image.”

But the Iranian mullahs are not merely concerned about the affectations of modernity. Mamedli, the cab driver, said that the crowds lining up for entry to Astara have surged since June, when hundreds of thousands of Iranians protested the allegedly rigged reelection of President Mahmoud Ahmadinejad. This has worrisome implications: the potential for political upheaval is acute in Iran’s north, where the bulk of the country’s university students live, along with most of its 15 million to 30 million ethnic Azeris (out of a total population of about 73 million). Prominent ethnic Azeris in Iran include Ahmadinejad’s presidential rival, Mir-Hossein Moussavi, the poet Mohammad Hossein Shahriar, and the filmmaker Kamal Tabrizi. Even the supreme leader of Iran, Ayatollah Ali Khamenei, is part Azeri. Many Azeris are so swollen with ethnic pride that Iranian officials suspect them of dual loyalty.

As a result, an Azerbaijani Ministry of Foreign Affairs official told me, “it’s common knowledge that the Iranians want the border shut down.”

At night, the courtyard next to the customs terminal was empty except for a few malnourished cats. On the Iranian side of the border, an imam and his flock were praying. Their voices drifted across the river and through the mesh of walls and fences. On Fountain Square, kids blasted Israeli pop music. A guard stopped me as I navigated the darkened market stalls, redolent of tea and rotting nectarines.

“The border is closed until morning,” he said. Then he nodded at the motel. “You want a room? It’s very nice, with a television and a girl.”

I said I was staying near the square and just taking a stroll.

“Only 10 manats,” he persisted. “I can get you this. Anything you want.” I laughed, and he lit a cigarette. “Come on,” he said, “don’t be a Muslim.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.