A bonfire set by demonstrators at the University of California at Berkeley. (Ben Margot/Associated Press)

After a violent rampage by anarchists forced the University of California at Berkeley to cancel right-wing provocateur Milo Yiannopoulos’s speech Wednesday night, President Trump was quick to blame the University.

The president’s imputation of institutional responsibility for the violence bizarrely distracted from the actual perpetrators — in contradiction to the facts, which support the view that Berkeley’s administration was doing its best to facilitate the peaceful exercise of First Amendment rights both by Yiannopoulos and those at the school who abhor him. It did so despite the urging of many students and faculty that it ban the event outright. (Trump did criticize the anarchists in a later tweet.)

Don’t take my word for it, though. In an interview Friday, Peter Sittler, a sophomore at Berkeley and vice president of the organization that sponsored Yiannopoulos’s visit, the Berkeley College Republicans, told me the school’s administration, from Chancellor Nicholas Dirks on down, “worked tirelessly to plan [the event] and make sure it went through.” From the time Sittler’s group first proposed hosting Yiannopoulis two months ago, the university “acted in good faith,” and was “fully committed to protecting our First Amendment rights,” he said.

Much has been made of the stiff security fee (almost $6,400) the university purportedly imposed on campus Republicans, which some have claimed was an attempt to discourage them from following through on the planned event. In fact, such fees, which essentially cover the costs of additional campus police positioned inside a given venue, are common for high-profile student-sponsored events at Berkeley. The group that hosted Justice Sonia Sotomayor had to pay more than $5,800 in 2011. As it happens, the Republicans did not even have to fork over a dollar for Wednesday’s event, since their contract with the university only called for payment if it actually came off successfully, which, alas, it did not.

Far from sticking the student group with the tab for security, the university spent tens of thousands of dollars of its own funds on extra police, including dozens of officers trained in crowd control brought in from other campuses in the California school system. These officers were deployed in an effort both to protect approximately 1,000 anti-Yiannopoulos demonstrators, who began gathering more than two hours before the 8 p.m. start time, and to keep them from disrupting the speech.

Unfortunately, the university’s plan did not reckon with the “black bloc,” the hooded, heavily armed political thugs who rolled in to campus around 5:45 p.m. and began setting off powerful firecrackers, lighting fires, smashing windows and generally creating so much mayhem that the police had no choice but to cancel the speech and escort the speaker away for his own protection.

Sittler told me he was deeply disturbed by the behavior of some fellow Berkeley students, anti-Yiannopoulos protesters who did not join the anarchists’ violence but in some cases cheered it on. Still, he does not fault the school for its failure to foresee “street-fighter anarchists showing up in full battle gear,” or its decision to cancel the event. “That was the only path forward,” he told me.

There is undoubtedly plenty of room for second-guessing the campus police’s performance. They eschewed mass arrests, in part because of the sheer difficulty and danger of wading into a crowd of students mixed with highly mobile, violent thugs — and in part because they were following practices recommended by an internal review panel after allegedly excessive police force against demonstrators on Berkeley’s campus in November 2011.

Obviously, the campus police are still struggling to get it right, and there’s a case to be made that a more aggressive posture was in order Wednesday night. (The city of Berkeley’s separate police force seems to have been particularly passive against the anarchists who also attacked in their jurisdiction, but that’s not the university’s fault.) On the other hand, those who decry the lack of arrests should acknowledge that, for all the chaos, only six people reported minor injuries on Wednesday night. With the safety of students and Yiannopoulos himself as their prime directive, the police commanders on scene decided “we’ll trade a few broken windows for that,” as university spokesman Dan Mogulof told me. Mogulof added that campus police are reviewing video of the events and plan to seek arrest warrants for any rioters they can identify. Contrary to Internet myth, there was no “stand down” order to the police from Cal’s administration.

For his part, Sittler told me he “wouldn’t be opposed” to working with the university on a possible do-over of the event, in which all concerned could apply the lessons learned from this one to assure success.

In short, it’s the height of irresponsibility and bias to attribute this violent denouement, as the president did, to the indifference of the university administration, much less its active complicity.

Berkeley’s leadership may never have Donald Trump’s support, or he theirs. But they certainly don’t deserve his vilification for what happened Wednesday night, especially since they were trying, successfully or not, to uphold the rights of people with whom they openly disagree. In that respect, Berkeley’s administrators set an example he would do well to emulate.