Before the 1979 Islamic Revolution, this city was pious and sedate.
The late Iranian American poet Nader Naderpour once listed as its main features "women with scarves over their heads, men clad in clerical robes, a single golden dome, old storks in the sky, one spiritless garden, a handful of lonely trees."
Qom became the bedrock of Iran's theocracy and remains one of the country's holiest places — home to 200,000 religious scholars, a destination for Shiite Muslim pilgrims and a center of Islamic thought in a country whose political system is controlled by the clerical establishment.
But the city of about 1 million is no longer single-mindedly religious, and its clerics are not immune to the anxieties bubbling beneath the surface of modern Iran.
One sign of a more complex side to Qom comes upon leaving the vast underground parking structure beneath the golden-domed shrine to Fatimah Masumeh, sister of the eighth imam in Shiite Islam. The exit leads to a multi-story shopping arcade whose brightly lighted shelves are lined with Disney stuffed animals, snacks and other not particularly religious souvenirs.
Above ground, Sayed Sadeq Mousavi, an elderly cleric wearing a black turban, was blunt about his politics: "At the beginning I was a revolutionary, but I have become disillusioned."
Mousavi, a cleric for 40 years, said the theocracy had not fulfilled the promises of the revolution led by Ayatollah Ruhollah Khomeini, who spent time in Qom studying religion. It had failed to end corruption, ensure Iran's oil wealth is shared equitably and create a more egalitarian society, the cleric said.
Iran today is an economic basket case, with most of the 80 million people struggling with unemployment or stagnant wages while a tiny elite — including family members of top clerics and politicians who enjoy control of state-owned industries — lives in extreme comfort.
Mousavi said it was little surprise that clerics had slipped in popularity and attendance at mosques across the Islamic Republic seems to dip lower and lower.
"Clergymen have no role in the hearts and minds of people as they did 38 years ago," he said. "The leaders of the revolution overpromised and under-delivered."
Mostafa Hagighat, wearing a green robe and a salt-and-pepper beard, said that when he travels to towns and villages during the annual holy month of Ramadan to promote Shiite Islam and answer people's religious questions, he receives a cool response.
"People don't even answer us when we say hello," Hagighat said. "It's like they're not on speaking terms with us."
"Imam Khomeini said clergymen should lead a simple life. If you drive a car, it should be a common car. But some clergy and politicians live a luxurious life. Even if they deserve it, in the eyes of the people it is not compatible with austerity."
Khomeini's successor as supreme leader, Ayatollah Ali Khamenei, has the final say on political and religious matters, but day-to-day governing is delegated to a civilian administration that is popularly selected — in highly stage-managed elections that ensure that only candidates acceptable to the theocracy can win.
Hagighat said the blurred line between clergy and government — the current president, Hassan Rouhani, is an establishment cleric — increasingly creates confusion among the people. The government has not stringently enforced the mullahs' rules banning satellite TV dishes and requiring women to cover their hair "because they need votes," he said.
Mohammad Ebadi, a portly cleric in a white turban, agreed that blending Islam and politics had tainted people's perception of the clergy.
"I'm a simple mullah, but people associate me with the theocracy," he said. "When they see me, they put all the blunders of the government on me."
A short walk from the main religious sites, a forlorn shopping center looms over the main road. The Zamzam complex was built several years ago to capitalize on Qom's growth, but few retailers have moved in because the property owner was hit with corruption allegations. Even the holy city isn't immune to shady dealings.
A coffee shop is one of the only functioning businesses in the building. A mural of a European sidewalk cafe filled one wall and a new, Italian-made espresso machine sat on a counter.
The owner, Ebrahim Mahmoudi, poured espressos, barely flinching when the call to afternoon prayer blared over the mall's loudspeaker. He had named his shop the Free Speech Cafe, but its decidedly secular vibe did not deter customers in the "city of mullahs."
On a recent day, a middle-aged mullah in a robe and turban came into the cafe and struck up such an intimate conversation that he left behind a pipe and tobacco flakes as gifts, Mahmoudi said. The man was considering sending his 21-year-old daughter to study in Germany, but had to grapple with leaving her on her own in the dissolute West.
"He knew she would be exposed to things," Mahmoudi said. "He told her: 'If you have sex, it does not mean you are a sinner.' I was surprised. It was a very progressive way for a mullah to talk."
Others too were adapting their faith. Marzieh Taheri, a woman from the southern port city of Bushehr, said she and her husband no longer sought out local clerics for guidance on personal matters. But she noted that she was making her 16th pilgrimage to the shrine in the last 12 years.
"It doesn't mean people are less Muslim," Taheri said. "There is some disenchantment with the system. But we still have Islam in our hearts."
Mostaghim is a special correspondent.
Follow @SBengali on Twitter