Tehran became the Qajar capital at the end of the eighteenth century and grew from a provincial town into the political centre of Shia Iran. Clerical authority and the state were entangled from the start and not always aligned: the tobacco protest of 1891 collapsed a foreign concession when a leading jurist forbade smoking, and clerics were on both sides of the Constitutional Revolution of 1905 to 1911, some arguing that an elected assembly was a Muslim duty and others that it substituted human law for God's.
The settlement that governs the city today came from lectures Ruhollah Khomeini gave in exile at Najaf, arguing that in the absence of the hidden imam the qualified jurist should hold political rule. After the revolution of 1979 that principle was written into the constitution, giving the leader authority over the armed forces, the judiciary and the vetting of candidates. Friday prayers at Tehran University became a political institution as much as a devotional one.
The city's religious geography reflects all this. The shrine of Khomeini south of Tehran is an enormous complex on the road to the old cemetery. Shah Abdol-Azim at Rey, on the southern edge of the metropolis, is a far older shrine and remains a working pilgrimage site. Armenian and Assyrian churches and several synagogues operate under the recognised minority arrangement, with reserved seats in parliament, while Sunni Muslims, a substantial minority nationally, have long sought a dedicated congregational mosque in the capital.