Swiss guards take part in a swearing-in ceremony at the Vatican. (FILIPPO MONTEFORTE/AFP/Getty Images)

On the first day of his criminal trial inside the walls of this city-state, a longtime Holy See priest-diplomat said Friday that he had viewed and shared child pornography while stationed in Washington, D.C., in an activity he described as “compulsive.”

Monsignor Carlo Capella said that while struggling two years ago with his new posting in Washington, he would send and receive images in one-on-one chats on Tumblr, a blogging site. Capella said the chats were short but “vulgar.”

“In retrospect,” Capella said, “I can see how repugnant they were.”

Capella’s trial, which will continue Saturday, comes after his indictment on charges of possessing and sharing child pornography and marks a major test of how the Vatican’s justice system will address one aspect of the abuse that has deeply scarred the Catholic Church.

The church has been accused by critics for years of shielding alleged perpetrators from harsh punishment, and the Vatican — which rebuffed a request from the United States to drop Capella’s diplomatic immunity and have him prosecuted in a U.S. court — is under pressure to handle the case with transparency. Several pool reporters were permitted in the courtroom, where three judges also heard testimony from a Vatican police investigator, who described several dozen examples of child pornography found on Capella’s electronics.

The charges Capella faces represent just one facet of the varied abuse cases that have ensnared the church and that have recently prompted notable gestures from Pope Francis. Two months ago, the pope apologized for his own “serious errors” in handling large-scale abuse in Chile; he later spoke of a “culture of abuse and coverup,” in what some Vatican watchers described as an unprecedented papal reference to the church’s systemic problems.

“We as a church started moving on from looking at rotting apples to looking into the rotting barrel,” said Father Hans Zollner, a member of the Pontifical Commission for the Protection of Minors.

The church is facing high-profile cases across the world, including one involving Cardinal Theodore McCarrick, the former archbishop of Washington, who was removed from the ministry this week after an allegation of abuse. In the United States and elsewhere, victims say they need to continue to press for accountability after seeing the church too often close ranks or ignore the severity of crimes.

“They protect their own. They get away with it,” said Peter Saunders, a founding member of Ending Clergy Abuse, who said he hoped Capella would be dealt with something other than “internal golf club rules.”

Wearing a black suit and a clerical collar, Capella on Friday said he’d had a long career “beyond reproach,” moving to diplomatic postings in India and Hong Kong. He had been stationed at the Holy See in the years before transferring to Washington and had kept busy. But in Washington, he said, his workload was much lighter, so moving there created a “void” — one he connected to his online behavior.

Capella remained at the Holy See’s Washington embassy until last year. He was recalled after the State Department notified officials at the Vatican that it suspected one of its diplomats of a possible crime “related to child pornography images.” Canadian police also issued an arrest warrant for Capella, accusing him of uploading child pornography to a social network while he was visiting the country in 2016.

The Vatican has said Capella’s case falls under its jurisdiction because he is a Holy See public official, “albeit abroad.”

Capella has been held recently in a cell in the Vatican’s police barracks. When the Vatican finished an investigation several weeks ago, it said in a brief statement that the evidence against Capella was “sufficient” to move to trial.

According to Vatican code, distributing or disseminating child pornography can be punished by up to five years of imprisonment and fines reaching 10,000 euros ($11,660). Penalties can be increased, the code says, “if a considerable quantity of pornographic material” is involved. The Vatican’s news release about the charges against Capella mentions a “large quantity” of material.

Major trials have been rare at the Vatican, largely because it has so few citizens, but in 2013, Pope Francis established that the city-state’s court should have jurisdiction over Holy See diplomats. The closest precedent for the Capella case came when a Polish archbishop, Jozef Wesolowski, was recalled in 2013 from a diplomatic posting in the Dominican Republic amid allegations of child abuse. He was later ordered to stand trial on charges of possessing child pornography, but he died before the trial began.

Stefano Pitrelli contributed to this report.