By Dave Warner

PHILADELPHIA (Reuters) - Cardinal Anthony Bevilacqua, the retired Catholic archbishop of Philadelphia whose competence to testify in an upcoming church sex abuse trial was hotly debated in court, died in his sleep on Tuesday, the church said.

The cardinal, 88, led the Philadelphia archdiocese, the nation's sixth largest, from 1988 to 2003. Church spokeswoman Donna Farrell said Bevilacqua died at St. Charles Borromeo Seminary, the traditional home for the leaders of the Philadelphia archdiocese, where he had lived since retirement.

Whether Bevilacqua was well enough to testify had become a pivotal issue in the sex abuse trial of three priests, one now defrocked, and a former archdiocese school teacher. Another church official, Monsignor William Lynn, faces charges of child endangerment but is not accused of abuse.

A jury is set to begin hearing charges in March against the five defendants in a crisis that has put the archdiocese on a national stage.

Child abuse controversies have rocked the Catholic Church in the United States in the last decade, and the church has paid out some $2 billion in settlements to victims, bankrupting a handful of dioceses.

As recently as Monday, lawyers battled in Common Pleas Court as to whether Bevilacqua was competent to testify. Lawyers for Lynn maintained that Bevilacqua's memory was shot and he should not testify, while the judge stuck to a prior ruling that he was competent to speak.

Farrell said she did not know the cause of the death. But the grand jury that handed down indictments in the abuse case a year ago reported that the cardinal's lawyer appeared before it to say that Bevilacqua suffered from both dementia and cancer.

Bevilacqua had a long career in the church beginning with his ordination in his hometown of Brooklyn in 1949.

He went on to earn a doctorate in canon law from Rome's Gregorian University, and held a master's degree in political science from Columbia University. He also received a degree in civil law from St. John's University in Queens.

Before arriving in Philadelphia to lead the archdiocese here, he served as the bishop of Pittsburgh.

His resignation was accepted in 2003. But his retirement was marked by probes into sex abuse in the church during his tenure as archbishop.

The grand jury acknowledged the reports from his lawyer about his health, but noted in its findings, "We are not entirely sure what to believe on that point."

Farrell said funeral arrangements were pending.

(Editing By Cynthia Johnston)