Riot police from a number of Bay Area departments fired tear gas and other projectiles and arrested dozens of demonstrators early Thursday to break up Occupy Oakland protests that had drawn thousands of participants.

Officers moved in near the protesters' City Hall encampment, where tents resprouted after officials last week ordered them razed. The police action came after a predominantly peaceful day of protest that attracted more than 7,000 people.

The evening appeared to be winding down peacefully when protesters declared victory at the Port of Oakland at 9 p.m. Wednesday--after authorities confirmed that a shift of workers scheduled to start work at 7 p.m. had been canceled. But as demonstrators massed again at the City Hall plaza, the situation devolved.

Demonstrators managed to gain entry to an empty building that had housed the Traveler's Aid Society, a nonprofit organization that assists the homeless but had suffered funding cuts. Leaflets indicated that protesters had targeted the building for "reuse." They branded it a new "community center" in Twitter feeds. Video from a local ABC affiliate's helicopter showed jubilant crowds flowing in and out of the building, where a banner marked "Occupy Everything" hung. Others built a barricade nearby, presumably to discourage police.

Shortly before midnight, local media reported that police officers from various agencies were suiting up in riot gear. Some demonstrators set the barricade aflame. Firefighters doused it. A police statement later said protesters had hurled rocks, explosives, bottles and flaming objects at officers.

A live video from a man who called himself #OakFoSho on Twitter, beamed to thousands of viewers into the early hours Thursday, showed Alameda County sheriff's deputies and Concord police officers among those authorities who surrounded the crowd on Broadway near Telegraph Avenue. Despite several volleys of tear gas, demonstrators boisterously played guitars and violins and sang classic songs such as Tennessee Ernie Ford's "Sixteen Tons" and Johnny Cash's "Folsom Prison Blues."

At 1:14 a.m., however, a loud explosion could be heard on the video coming from the encampment. Oakland police, who had maintained a low profile all night, lined the plaza. Groggy people in tents could be heard telling police to go deal with troublemakers instead. One protester was hit in the leg with some kind of projectile. Video showed him running, then standing doubled over, whimpering in pain, as others from the encampment rushed to help him.

"You just fired on and injured an unarmed person," one man could be heard yelling.

The Oakland Tribune reported that the man was taken away in an ambulance after fellow demonstrators repeatedly asked for help.

By 1:48 a.m., officers on Broadway could be heard issuing a dispersal order. It was unclear whether police would attempt to clear the plaza or were just trying to clear demonstrators who were in the streets.

At 2 a.m., demonstrators called on one another to "remain nonviolent." They chanted, "We are Scott Olsen," in reference to the Iraq War veteran who was injured by a police projectile last week. Images of that police action, which came in response to demonstrators about 12 hours after the camp was razed, were beamed around the world. Police maintain that they were defending themselves against some in the crowd who threw bottles, rocks and other objects, but criticism was widespread that nonviolent demonstrators had been caught up in the assault.

Wednesday's action drew more than 7,000 people, including teachers, youths, seniors, union members and other citizens who said they were concerned about economic inequality. At an evening briefing, interim Oakland Police Chief Howard Jordan said officials believed that only about 60 or 70 of them -- black-garbed with kerchiefs covering their faces -- were believed to be committing acts of vandalism. Throughout Wednesday, members of the crowd had attempted to redirect and dissuade those self-described anarchists. When they broke windows and defaced several banks with graffiti, some Occupy Oakland protesters returned to scrub the walls of a Wells Fargo bank branch. Another placed a sign on the shattered window of a Chase bank branch that read, "We are better than this."

Some on the plaza said a small faction of demonstrators may have broken into a coffee shop, earning the ire of others in the movement.

Mayor Jean Quan, who had been criticized by demonstrators after last week's police action, allowed them to reestablish their camp. She then earned the ire of a number of police officers and some of Oakland's business community. She and Jordan had said Wednesday that police would maintain a minimal presence but were prepared to move in if property or safety was compromised.

[For the record, Thursday, 7:37 a.m.: A previous version of this post said protesters were waiting for a change in shift of officers; they were waiting for a change in shift of port workers.]