PHILADELPHIA — Prosecutors overseeing a child sex-abuse case involving three Roman Catholic priests can reference molestation claims against more than 20 other clergymen to try to establish a pattern of how such allegations were handled, a judge ruled Monday.

The ruling allows an "overwhelming amount of evidence" into the case, defense lawyer William Brennan said in court, even though the judge excluded accusations against several other priests that prosecutors had sought to introduce.

Common Pleas Judge M. Teresa Sarmina said the evidence is necessary for jurors to understand the totality of the circumstances and to draw accurate inferences in the upcoming trial against Monsignor William Lynn.

"The trial court is not required to sanitize the trial to eliminate all unpleasant facts from the jury's consideration, where those facts ... form part of the history and natural development of the events and offenses for which the defendant is charged," Sarmina said.

Lynn, 61, is charged with child endangerment and conspiracy for allegedly shuffling predator priests to unwitting parishes while he served as secretary of clergy for the Archdiocese of Philadelphia from 1992 to 2004.

Now on leave, Lynn is the first U.S. church official ever charged over accusations of administrative failings in the priest-abuse crisis.

Prosecutors plan to show a pattern of behavior in how Lynn handled the careers of priests credibly accused of molestation. They sought permission to introduce evidence regarding 27 of 63 priests named in a 2005 grand jury report on the scandal; Sarmina approved 22 on Monday.

Because of the statute of limitations, none of the priests was charged.

Defense lawyers wanted to limit evidence to Lynn's actions regarding the placements of the priest and ex-priest on trial with him. The Rev. James Brennan and defrocked priest Edward Avery are each charged with raping a boy. All three defendants have denied the allegations.

The defense has stressed that Lynn followed orders from his then-boss, Cardinal Anthony Bevilacqua, who was never charged despite two grand jury reports that blasted both the cardinal's leadership and his testimony. Bevilacqua died last week.

Prosecutors contend Lynn kept abusive priests on the job even though he was among a select few who had access to molestation complaints kept in "secret archives" at the archdiocese.

On Monday, Sarmina said Lynn's own earlier testimony that he looked at the confidential documents "opens the door to the content of those files."

Also at the hearing, defense lawyers said they learned only Friday about 22,000 pages of documents recently released by the archdiocese to the district attorney's office. Jeffrey Lindy, who represents Lynn, said he didn't know what was in the material or why it was just coming out now.

"I don't know how the heck any of us are going to be ready for trial," Lindy said.

Prosecutors, too, are unsure how many documents might be duplicates of material already on the record, Assistant District Attorney Patrick Blessington said. He added that no one wants "to play needle in a haystack."

Archdiocese spokeswoman Donna Farrell said she could not comment on the documents because of a gag order in the case.

Attorneys on both sides could not comment on the judge's ruling for the same reason.

Jury selection is scheduled for later this month. The trial is scheduled to start in March.

Lynn faces as many as 28 years in prison if convicted on all counts.