A federal judge has dismissed nearly all the claims made in a $23 million lawsuit filed by a woman who was pepper-sprayed last year at UC Berkeley during a protest against right-wing provocateur Milo Yiannopoulos.

Oakland resident Kiara Robles filed the August 2017 suit against six individuals and entities, including the UC Board of Regents, the city of Berkeley and people she said were members of the far-left activist group Antifa.

Robles said the defendants “willfully withheld police officers” to protect pro-Yiannopoulos and pro-President Trump supporters like herself because they were at odds with the defendants’ political beliefs.

U.S. District Judge Claudia Wilken on Friday dismissed all claims against the regents and Berkeley, and part of a claim against alleged Antifa member Raha Mirabdal. Robles said that Mirabdal shined a flashlight “aggressively” in her face to incapacitate her and left her prone to attacks by other Antifa members.

In a 23-page ruling, Wilken wrote: “There are simply not enough factual allegations to show that it is plausible that Berkeley has an official policy or custom of ‘selectively providing police support and withholding police support to conservative events, rallies, and protests.’”

The ruling dismissed individual claims against UC President Janet Napolitano and UC Berkeley Chancellor Nicholas Dirks, noting that “the First Amendment does not require the individual defendants to protect Robles against the actions of others.”

The judge also dismissed a claim against Antifa.

Wilken left a window open for Robles to pursue civil action against Mirabdal and gave her 21 days to file an amended complaint.

Robles did not immediately respond to requests for comment Saturday.

In February 2017, Yiannopoulos was scheduled to speak at UC Berkeley. What began as a peaceful demonstration erupted into violence, with masked anarchists hurling smoke bombs, smashing windows and ripping down metal barricades.

The university ultimately canceled the event.

Robles was doing an interview with a KGO-TV news reporter when an unseen assailant pepper-sprayed her.

Robles had filed a similar suit in June 2017 with an expanded list of defendants, including Rep. Nancy Pelosi, D-San Francisco, and liberal philanthropist George Soros, but later dropped it.

Megan Cassidy is a San Francisco Chronicle staff writer. Email: megan.cassidy@sfchronicle.com Twitter: @meganrcassidy