A now-retired Roman Catholic priest was charged Monday with forcing a 10-year-old Pennsylvania boy to perform oral sex on him while counseling the fourth-grader about misbehaving on a school bus.

The state attorney general’s office accused the Rev. John Thomas Sweeney of committing felony involuntary deviate sexual intercourse at St. Margaret Mary Elementary School in Lower Burrell during the 1991-92 school year.

The boy, now 35 and serving in the Coast Guard, told investigators that after the attack Sweeney’s secretary gave him milk and cookies, prosecutors said.

“He is a hero for his service,” Attorney General Josh Shapiro said. “Today we know him as a hero for coming forward to share his story with us.”

Defense attorney Francis R. Murrman said Sweeney, 74, “vehemently” denies the charges, noting they date back some 26 years and the details were only disclosed as Sweeney was being arraigned.

“There’s abbreviations in there, there’s dates, there’s all kinds of allegations,” Murrman said. “We don’t know if 75 percent of them are accurate, 60 percent of them are accurate or 30 percent of them are accurate.”

A grand jury report used to charge Sweeney said that someone made an anonymous complaint to Lower Burrell police about Sweeney in August, shortly before a U.S. marshal who is related to the accuser called them to say the accuser told him Sweeney had abused him.

The unnamed marshal said the accuser was moved to disclose the allegation after watching “Spotlight,” a 2015 film about the Boston Globe’s investigation of priest abuse.

The accuser told the grand jury in February that Sweeney first lectured him about his behavior, then placed his hands on the back of the accuser’s head and assaulted him.

Sweeney told grand jurors he could not remember the name of his secretary “until he was reminded that he recently attended her funeral,” the jury wrote. “In fact, evidence was introduced that Sweeney actually conducted Mass at her funeral.”

The Greensburg Diocese said Sweeney was removed as pastor of Holy Family Parish in West Newton last year after church officials learned of the allegation.

Sweeney became a priest in 1970 and served in seven western Pennsylvania parishes: in Latrobe, Greensburg, Smock, Freeport, Apollo, Lower Burrell and West Newton.

The diocese said its records indicate Sweeney has not been the subject of any other child sexual abuse complaint.

Sweeney was released on $50,000 unsecured bail.

Lower Burrell, where the elementary school is located, is about 25 miles (40 kilometers) northeast of Pittsburgh.