The demonstrators included “Black bloc” protesters, who wear masks and black clothing to present a unified front as they disrupt events, making it difficult for police to recognize individuals in the group. They are often seen at protests organized by groups such as Black Lives Matter and Occupy Wall Street, destroying property and setting fires. They torched a limousine in Washington last month on the day of Trump’s inauguration, and a group spray-painted buildings and smashed electrical boxes during a demonstration in Portland, Ore., earlier in January. When a group of them arrived at Berkeley, it swiftly changed the tenor of the peaceful demonstration.

Some students organized to try to protect the campus and businesses nearby, and then to pick up broken glass, scrub graffiti off buildings and clean the campus after the violence.

William Morrow, president of the Associated Students of the University of California, said in a statement that the cleanup effort showed what Berkeley students care about. “Last night was not reflective of that,” he said; students were expecting a peaceful protest, an exchange of opinions and a dance party, “but outside agitators infiltrated our community and didn’t treat it with the respect for our historic tradition of non-violence.”