DEDHAM, Massachusetts — Former Cardinal Theodore McCarrick, the once-powerful American prelate who was expelled from the priesthood for sexual abuse, pleaded not guilty Friday to sexually assaulting a 16-year-old boy during a wedding reception in Massachusetts nearly 50 years ago.

McCarrick, 91, wore a mask and entered suburban Boston’s Dedham District Court hunched over a walker. “Shame on you!” a protester shouted.

He did not speak during the hearing, at which the court entered a not guilty plea on his behalf, set bail at $5,000, and ordered him to stay away from the victim and have no contact with minors.

McCarrick is the only U.S. Catholic cardinal, current or former, to ever be criminally charged with child sex crimes.

McCarrick’s attorney, Katherine Zimmerl, said afterward that they are “looking forward to addressing the allegations in court” and would have no other immediate comment.

The next hearing was set for Oct. 28.

McCarrick, who now lives in Dittmer, Missouri, faces three counts of indecent assault and battery on a person over 14, according to court documents. He can still face charges in the case because he wasn’t a Massachusetts resident and had left the state, stopping the clock on the statute of limitations.

“Today’s arraignment provides hope for many clergy sex abuse victims and survivors that justice will prevail, truth will be told and children will be kept safe,” said Mitchell Garabedian, an attorney for the victim who has represented dozens of others who allege they were abused by clerics.

“My client, in coming forward, has shown an enormous amount of courage, and he’s ready to see this trial through the end,” he said.

McCarrick’s fall began in 2017 when a former altar boy came forward to report the priest had groped him when he was a teenager in New York. The next year, the Archdiocese of New York announced that McCarrick had been removed from ministry after finding the allegation to be “credible and substantiated,” and two New Jersey dioceses revealed they had settled claims of sexual misconduct against him in the past involving adults.

Pope Francis defrocked McCarrick in 2019 after a Vatican investigation determined he sexually abused minors, as well as adults.

A two-year internal investigation into McCarrick found that three decades of bishops, cardinals and popes downplayed or dismissed reports of sexual misconduct. Correspondence showed they repeatedly rejected the information outright as rumor and excused it as an “imprudence.”

The investigative findings released last year pinned much of the blame on Pope John Paul II, who appointed McCarrick archbishop of Washington, D.C., despite having commissioned an inquiry that confirmed McCarrick slept with seminarians.

In the Massachusetts case, authorities began investigating McCarrick after the accuser’s attorney, Mitchell Garabedian, sent a letter to the district attorney’s office alleging the abuse, according to the court records.

The man told authorities during an interview in January that McCarrick was close to his family when he was growing up and that the abuse started when he was a young boy.

The man said that during his brother’s wedding reception at Wellesley College in June 1974 — when he was 16 — McCarrick told him that his father wanted him to have a talk with McCarrick because the boy was “being mischievous at home and not attending church.”

The man said that the two of them went for a walk around campus and McCarrick groped him before they went back to the party. The man said McCarrick also sexually assaulted him in a “coat room type closet” after they returned to the reception, authorities wrote in the documents.

The man told investigators that before leaving the room, McCarrick told him to “say three Our Fathers and a Hail Mary or it was one Our Father and three Hail Marys, so God can redeem you of your sins,” according to the report.

He also described other instances of sexual abuse by McCarrick over the years, including when the man was an adult, according to the court records. The Associated Press generally doesn’t identify people who report sexual assault unless they agree to be named publicly.

Ordained as a priest in New York City in 1958, McCarrick ascended the church ranks despite apparently common knowledge in the U.S. and Vatican leadership that “Uncle Ted,” as he was known, slept with seminarians.

The case against McCarrick and other Catholic clerics is especially raw in Boston, where the global priest sex abuse scandal first was exposed.

Reporting by The Boston Globe’s Spotlight team helped break open the scandal in the Archdiocese of Boston in 2002. The reporting uncovered how dozens of priests in the archdiocese had molested and raped children for decades while church higher-ups covered it up and shuffled abusive priests from parish to parish.

A movie about the Globe’s reporting, “Spotlight,” won the 2016 Academy Award for best picture.

McCarrick became one of the most visible Catholic Church officials in the U.S. and even served as the spokesman for fellow U.S. bishops when they enacted a “zero tolerance” policy against sexually abusive priests in 2002.

Cardinal George Pell was convicted of sexual abuse in his native Australia, but his conviction was ultimately thrown out. And French Cardinal Philippe Barbarin was convicted but later acquitted of charges that he covered up for a notorious pedophile priest.

Associated Press writer Nicole Winfield in Rome contributed to this report.