Tens of thousands of Iranian mourners turned the funeral procession of the country's most senior dissident cleric into an anti-government protest Monday, chanting "death to the dictator" and slogans in support of the opposition amid heavy security.

Giant crowds filled major streets, beating their chests in mourning, waving banners in the green colors of the opposition and shouting denunciations of Iran's rulers as Grand Ayatollah Hossein Ali Montazeri's body was carried to a shrine in Iran's holy city of Qom.

Some mourners clashed briefly with security forces, throwing stones — and hard-line pro-government militiamen charged some protesters until police held them back, opposition Web sites said. The militiamen tore down mourning banners and ripped to pieces posters of Montazeri near his home, the Hammihan Web site reported. Iranian authorities have barred foreign media from covering the rites.

The death of Montazeri on Sunday, at the age of 87, pushed Iranian authorities into a difficult spot. They were obliged to pay respects to one of the patriarchs of the 1979 Islamic Revolution and the one-time heir apparent to Ayatollah Ruhollah Khomeini.

But officials also worried that his mourning rites could give a new push to opposition protests, particularly because they coincide with a week of traditional rallies commemorating a revered Shiite martyr. Montazeri broke with Iran's clerical leadership and became a vehement critic, denouncing Supreme Leader Ayatollah Ali Khamenei and calling the postelection crackdown the work of a dictatorship.

Mourners shouted "Death to the Dictator" and other slogans in displays of anger against Iran's ruling establishment during the procession in Qom, a city of shrines and clerical seminaries about 60 miles (100 kilometers) south of Tehran, witnesses said. The witnesses spoke on condition of anonymity for fear of arrest.

Marchers held aloft black-rimmed portraits of Montazeri and green banners and wrist bands in a powerful show of support for the Green Movement of opposition leader Mir Hossein Mousavi, who attended the funeral along with another prominent protest leader, Mahdi Karroubi.

Footage posted on the Web showed massive crowds chanting in the streets of Qom and beating their chests in a sign of mourning, as Montazeri's body was carried in a coffin draped in black cloth around the city's main shrine several times then taken to a nearby cemetery for burial alongside his son, who died in the early days of the Islamic Revolution.

Security forces clashed with mourners shouting slogans outside Montazeri's house in Qom, and some protesters threw stones, the opposition Web site Norouz reported. It said an unspecified number of mourners were arrested. The report could not be independently confirmed, and witnesses did not report major clashes.

Some reformist sites reported that Mousavi's car was attacked as he left Qom and at least one member of his entourage was injured. The reports could not be independently confirmed.

Thousands of mourners also marched in the cleric's hometown of Najafabad, near the central city of Isfahan. Web footage showed crowds of men beating their chests and chanting, "Oppressed Montazeri, you are with God now."

Women in black robes shouted, "Dictator, dictator, Montazeri is alive," and "Montazeri, you who spoke the truth: Your path will be followed."

On Monday, access to the Internet in Iran was slow, and cellular telephone service was unreliable. The government has periodically restricted communications in an attempt to prevent protesters from organizing.

Authorities were clearly concerned Montazeri's death could set off a string of opposition protests linked to his funeral rites. Traditionally, memorial ceremonies are also held seven days after a death. Moreover, Montazeri's seventh day homage will fall on one of the most important Shiite religious days, marking the martyrdom of a revered 7th century leader — giving even more fuel for a rally.

In another sign of efforts to silence opposition media, authorities ordered the closure of a small, liberal-leaning newspaper, Andishe-no, or New Thinking. The paper had only a limited circulation, but was one of the few reformist publications remaining. Iranian officials also have tried to block opposition Web pages and other sites.

Montazeri broke with the regime in the 1980s after claiming that the ruling clerics violated the ideals of the revolution by taking absolute power rather than serving as advisers to political leaders. He spent five years under house arrest and had only a minor role in political affairs after being released in 2003.

But the outrage after June's disputed presidential election gave him a new voice that resonated with a younger generation. His most pivotal moments came in the summer when he denounced the "despotic" tactics and "crimes" of the ruling clerics — a bold step that encouraged protesters to break taboos about criticism of Khomeini's successor, Supreme Leader Khamenei.

In demonstrations earlier this month, students shouted "Death to the dictator!" and burned pictures of Khamenei — an act that was almost unthinkable just a few months ago.

State television made only a passing reference to Monday's funeral and did not broadcast any images. It mentioned, however, that mourners were chanting anti-government slogans.

On Sunday, Khamenei praised Montazeri as a respected Islamic scholar, but noted his falling out with Khomeini and other leaders of the revolution.

Montazeri's grandson, Nasser Montazeri, said he died in his sleep overnight. The Web site of Iranian state television quoted doctors as saying Montazeri had suffered from asthma and arteriosclerosis, a disease that thickens and hardens arteries.

The International Campaign for Human Rights in Iran said one of Montazeri's followers and a government critic, Ahmad Ghabel, was arrested while driving to Qom with his family to attend the funeral. The New York-based group called on the government not to interfere in the commemorations.

Another prominent critic, filmmaker Mohammad Nourizad, was arrested on a charge of insulting officials, the state news agency IRNA reported Sunday. Nourizad, once a conservative government supporter, wrote a letter of protest to Khamenei in September urging him to apologize to the nation for the postelection crackdown.

Montazeri was one of the leaders of the revolution and he helped draft the nation's new constitution, which was based on a concept called velayat-e faqih, or rule by Islamic jurists. That concept enshrined a political role for Islamic clerics in the new system.

But a deep ideological rift soon developed with Khomeini. Montazeri envisioned the Islamic experts as advisers to the government who should not have outright control to rule themselves. He was also among those clerics who believed the power of the supreme leader comes from the people, not from God.

Taking an opposing view, Khomeini and his circle of clerics consolidated absolute power.