TEHRAN, Iran (CNN) -- Security forces in Iran on Thursday confronted thousands of protesting Iranians across the city, first at a cemetery and later at a prayer venue and near a government building, witnesses and news reports said.

Mourners gather around the grave of Neda Agh-Soltan in Beheshte Zahra Cemetery. more photos »

Clashes erupted at the cemetery as two of Iran's main opposition leaders tried to join the several thousand people at a memorial for the slain woman who became the symbol of Iran's post-election violence, witnesses said.

The gathering was banned, but participants ignored the government strictures.

However, security forces barred opposition leaders Mir Hossein Moussavi and Mehdi Karrubi from the gravesite of Neda Agha-Soltan, the 26-year-old woman shot in election protests on June 20, witnesses and news reports said.

More than 3,000 people were gathered at Agha-Soltan's grave, a witness said.

Mourners arrived on the religiously significant 40th day after the fatal shooting in Tehran. For Iranians, a predominantly Shiite Muslim population, the 40th day after a death marks the last official day of mourning.

At the cemetery, security forces used tear gas to clear the area of demonstrators and mourners. A witness said riot police and Basij militia were at the scene, but the confrontations with people in the crowd involved the militia. Watch a report on the memorial clashes »

The witness spotted instances of the baton-wielding militia charging the gathering, and said as many as nine beatings were seen. Other people appeared to have been beaten as they ran from police, the witness said. One of the mourners had a bloody head and one woman said she was struck on the back of the neck.

One security force member sustained some sort of injury to the head and was bloodied. It is unclear exactly how that person was injured.

A confrontation between women protesters and police also was seen. The women shouted, "Don't beat up our young people. You, our Muslim brothers. It is a shame to beat up our young people."

The crowd chanted "Ya Hossein, Mir Hossein," the first a reference to the revered Shiite imam and the second a reference to Moussavi. Then there were more chants of "Allah wa Akbar," or God is great. iReport.com: Share your photos, video, stories

Despite reports of arrests, none were seen on the mourning day.

U.S. State Department spokesman Ian Kelly said using force to "break up a group of people who were trying to exercise an important ritual in Islam, the mourning after 40 days," was "particularly disturbing."

"We stand by the Iranian people who are exercising their universal right to self-expression and demonstrating peacefully," Kelly said.

Iran's state-run news agency, IRNA, reported that the mourners "disrupted the order" in the city and damaged public and private property and that security forces were merely trying to control the "illegal activity" of the group.

IRNA also reported that Tehran residents in the area were angry with the constant protests and wanted a stronger response from the security forces.

Another witness told CNN that police directing traffic at the cemetery were helpful and friendly, in stark contrast to the riot police and Revolutionary Guard members who were at the gravesites.

From the cemetery, the mourners arrived at the Mossalla, a building under construction that is expected to be the main venue of Tehran's Friday prayers, witnesses said. A couple thousand people demonstrated and police worked to disperse the crowd -- which also was defying a ban on such a gathering.

"The police tried to discourage drivers from driving the main highway that would lead to central Tehran, but very few listened," one witness said. "Soldiers standing along the streets flashed the peace sign back at the honking cars with large smiles on their faces. It was obvious the soldiers and police forces were with the people."

Thousands also marched and chanted along a prominent thoroughfare called Vali Asr Street, chanting slogans such as "Death to the dictator" amid the honking of car horns, a witness said. Amateur video posted Thursday on several Web sites and submitted to CNN's iReport showed a security officer swinging a baton at a demonstrator. CNN cannot confirm the circumstances of the images.

Protesters gathered near the Interior Ministry building and trash cans were set ablaze, another witness said. Police on motorcycles attempted to break up the gathering, and one security officer was seen wielding a gun.

Moussavi was the chief challenger of incumbent President Mahmoud Ahmadinejad in the June presidential elections, which the government said Ahmadinejad won in a landslide but many Iranians think was rigged.

Moussavi had said on his Web site that he and fellow reform candidate Karrubi would commemorate Agha-Soltan's death with her mother at the Behesht-e-Zahra cemetery.

At the cemetery, a witness said a car identical to a vehicle belonging to Moussavi drove through the area. It was not clear if Moussavi was in the vehicle, but people were sitting atop and around the car as if to protect it. The car left the scene.

In the days after the June vote, thousands of Iranians took to the streets to protest the results.

The government cracked down. Hundreds were detained in prison, among them 50 "political figures" accused of playing key roles in the street demonstrations that turned violent, Iranian media reported Wednesday.

Among those still reportedly detained is Shahpour Kazemi, Moussavi's brother-in-law, according to Moussavi's wife.

Others include Behzad Nabavi, a Moussavi ally, and Mostafa Tajzadeh, who served under Iranian President Mohammad Khatami -- a Moussavi supporter -- the Iranian Labor News Agency reported Tuesday.

All About Neda Agha-Soltan • Iran