Iranian dissident cleric Grand Ayatollah Hossein-Ali Montazeri was buried in the religious city of Qom on Monday, a day after he died at the age of 87.
According to witnesses and opposition websites, tens of thousands of people, including a large number of local opposition figures, attended the funeral and turned it into a political rally.
Witnesses said there was a massive police deployment in Qom, 130 km south of the capital, Tehran.
Montazeri, who died on Sunday, was the designated heir of the leader of the Islamic revolution, Ayatollah Ruhollah Khomeini, but was dismissed in March 1989 for criticising the Islamic system.
He was also a fierce critic of President Mahmoud Ahmadinejad and accused his government of dictatorship after his disputed re-election in June.
Websites said that there were clashes between the opposition and supporters of Ahmadinejad. Witnesses in Qom confirmed clashes near Montazeri's house and also near the shrine where he was buried.
The news network Khabar reported that opposition supporters tried to provoke confrontations but claimed the Montazeri family called on people not to politicize the ceremony.
According to reports, police also clashed with protestors after they began shouting anti-Ahmadinejad slogans.
There have been reports that a peaceful mourning ceremony was also held in Montazeri's hometown of Najafabad, in central Iran, where the ayatollah was acknowledged as one of highest religious figures and where he had many supporters.
Despite clashes between protestors and police in Qom, there were no reports of arrests.
With the foreign media banned from covering the funeral, there was no way to verify reports on opposition websites.
Witnesses, however, confirmed that both Mir-Hossein Moussavi, the leader of Iran's opposition Green Movement, and former parliament speaker Mehdi Karroubi attended the ceremony.
It was unclear whether the other two opposition leaders, former presidents Mohammad Khatami and Akbar Hashemi-Rafsanjani, were present.
Other unconfirmed reports on reformist websites said a group of opposition supporters was blocked by police on their way from Tehran to Qom.
Meanwhile Moussavi's website reported that the car of the Green Movement leader was attacked on his way back from Qom to Tehran by unidentified assailants riding on motorbikes, believed to be Ahmadinejad supporters.
The website Kalameh reported that one of the assailants attacked his car, broke the car's rear window, insulted Moussavi and injured one of his accompanying aides.
Kalameh did not give further details and the report has not yet been confirmed or been carried by local agencies.