A federal judge under scrutiny for posting sexually explicit material on his own Web site declared a mistrial Friday in an obscenity trial over which he was presiding.

Judge Alex Kozinski said he would ask that the case be assigned to another judge.

Kozinski is chief judge of the 9th U.S. Circuit Court of Appeals but was serving as a trial judge in a federal obscenity prosecution of a man who distributed videos showing bestiality and extreme fetishes.

"In light of the public controversy surrounding my involvement in this case, I have concluded that there is a manifest necessity to declare a mistrial," Kozinski wrote in his order.

The material Kozinski had on his Web site included photos of naked women on all fours painted to look like cows and of a man cavorting with a sexually aroused farm animal, according to the Los Angeles Times, which first reported about the images in a Wednesday story. The extreme pornography at the center of the trial depicted extreme fetishes, including bestiality, violence against women and sexual activity involving feces and urine.

The postings on the judge's Web site came to light earlier this week when opening statements were under way. The trial was suspended Wednesday after jurors had already watched some of the videos.

Kozinski on Thursday asked an ethics panel of the 9th Circuit to investigate his own conduct and pledged to cooperate fully. He also asked the circuit's judicial council to ask Supreme Court Chief Justice John Roberts to assign the inquiry to a panel of judges outside the 9th Circuit's jurisdiction of nine western states.

Kozinski did the right thing in declaring a mistrial and removing himself, said Stephen Gillers, a New York University School of Law professor who is an expert on judicial ethics.

"Those of us who know him know that he could have tried this case fairly, but the public would have thought the court system had lost its marbles if Kozinski had stayed on the case," Gillers said.

In the obscenity case, the U.S. Department of Justice is prosecuting Ira Isaacs, 57, on four counts, including importation or transportation of obscene material for sale. He faces a maximum of 20 years in prison and forfeiture of assets if convicted.

Defense attorney Roger Jon Diamond said he was very upset about the mistrial and was considering his options.

He said it was unclear whether the case could proceed with the same jury and a new judge.

Diamond accused the Department of Justice of "intimidating Judge Kozinski into doing this." Justice Department attorneys are trying the case.

"We all have to be nervous and concerned when the executive branch can do this to anybody, including the sitting federal appeals judge," Diamond said.

Department of Justice spokeswoman Laura Sweeney in Washington, D.C., declined to comment on any aspect of the case.

Diamond said there had been meetings with the prosecutor, Justice Department lawyer Kenneth Whitted, and with Brent D. Ward, the head of the government obscenity task force, since the controversy erupted.

"I made a proposal for a stipulated mistrial, providing the retrial would not take place until early next year and that was flatly rejected by Mr. Whitted and Mr. Ward," Diamond said. "They wanted to disqualify Kozinski and go ahead immediately with the same jury and a new judge Monday morning."

Diamond said he was certain jurors knew of the controversy but he had favored allowing the trial to proceed with Kozinski presiding, rather than simply changing judges.

"If we were to come back to court with a new judge, it would send a message to the jury that Judge Kozinski did something wrong, which is not true. The jury would get the impression that something naughty had occurred, which is not the case."

Cyrus Sanai, a Beverly Hills lawyer who has had a long-running dispute with the 9th Circuit, told The Associated Press he discovered the sexual content while monitoring the judge's Web site in December. Sanai said he downloaded the files then started contacting reporters to bring attention to what he called widespread ethical problems on the 9th Circuit.