SAN FRANCISCO (AP) — The sexual misconduct allegations that have cut a swath through Congress brought down a prominent member of the judicial branch Monday with the resignation of Alex Kozinski, a federal appeals court judge known for his blunt and colorful legal opinions.

Kozinski, a 67-year-old member and former chief judge of the 9th U.S. Circuit Court of Appeals, the nation’s largest federal appeals court, said in a statement that a battle over the accusations would not be good for the judiciary. He retired, effective immediately.

The move came days after the 9th Circuit opened a misconduct inquiry following the first in a pair of Washington Post stories that said 15 women — some of whom worked for him as law clerks or in other positions — accused him of groping them, making lewd comments or showing them pornography.

Kozinski, who was known to have a bawdy side well before his resignation, said that while speaking in a “candid way” with male and female clerks, he “may not have been mindful enough of the special challenges and pressures that women face in the workplace.”

“It grieves me to learn that I caused any of my clerks to feel uncomfortable; this was never my intent,” he said. “For this I sincerely apologize.”

The 9th Circuit hears cases from nine Western states, including California and Arizona, and has been bitterly criticized by President Donald Trump following rulings that blocked his travel ban against mostly Muslim countries.

Some legal experts said Kozinski’s resignation may help the judiciary avoid an embarrassing, drawn-out investigation that would damage its reputation and potentially imperil its independence. Federal judges are appointed for life and can be removed only by impeachment by Congress. The goal is to maintain judicial independence by preventing the easy removal of judges for unpopular decisions.

“I take him at his word that he probably understood that this could be very detrimental to the federal judiciary and to individuals in the judiciary and his colleagues,” said Carl Tobias, a professor at the University of Richmond School of Law.

It was not clear whether the investigation of Kozinski by the judiciary will continue. An email to a 9th Circuit spokesman was not immediately returned.

Complaints against judges rarely result in their forced removal from the bench. But some federal judges have stepped down in recent years amid controversy.

Mark Fuller, a trial judge in Alabama, who left the bench in 2015 following an allegation that he beat his wife during a fight in a hotel room in Atlanta; and Richard Roberts, the chief trial judge in Washington, D.C., retired on a medical disability on the same day in 2016 that a woman filed a lawsuit accusing Roberts of sexual assault in 1981.

The son of Holocaust survivors from Romania, Kozinski was appointed to the appeals court in 1985 when he was in his mid-30s by Republican President Ronald Reagan. He is known as a libertarian.

Clerkships in his office were prestigious, and many of his clerks landed positions working for U.S Supreme Court justices.

Heidi Bond, who clerked for Kozinski from 2006 to 2007, told the Post she worried that leaving without a good recommendation might ruin her career.

Bond told the newspaper Kozinski called her into his office several times to look at images of naked people, asking her if she thought the pornography was photo-shopped or if it aroused her sexually.

Christine Miller, a retired U.S. Court of Federal Claims judge, told the newspaper Kozinski grabbed her breasts during a car ride in 1986 after a legal community function in the Baltimore area. She said it came after she declined his offer to go to a motel and have sex.

On the bench, Kozinski was an eccentric. He crammed over 200 movie titles into a 1990 opinion in a lawsuit involving a movie theater chain.

In another case, he wrote that lethal injection should be scrapped in favor of the firing squad, saying, “Sure, firing squads can be messy, but if we are willing to carry out executions, we should not shield ourselves from the reality that we are shedding human blood.”

“If we, as a society, cannot stomach the splatter from an execution carried out by firing squad,” he added, “then we shouldn’t be carrying out executions at all.”

The Los Angeles Times in 2008 reported that Kozinski maintained a publicly accessible website of pornography, some of which he defended in an interview to the newspaper as funny.

A judicial investigation at the time concluded that Kozinski showed poor judgment but had not intended for the material to be seen by the public.

He was also accessible and a passionate advocate for the rights of people accused of crimes. He often picked up the phone at his chambers and regularly invited members of the legal community to movie screenings — dubbed “Kozinski’s Favorite Flicks” — that he hosted at the courthouse with food and drinks.

Allegations of sexual misconduct have toppled powerful men in Hollywood, media and politics in recent weeks. Three Capitol Hill politicians have announced their resignations: Rep. John Conyers, D-Mich., Rep. Trent Franks, R-Ariz., and Sen. Al Franken, D-Minn.

___

Associated Press writers Janie Har, Christopher Weber in Los Angeles and Mark Sherman in Washington, D.C. contributed to this report.