Pope Francis has made a powerful and emotional plea for forgiveness in front of hundreds of thousands of people in Dublin at the closing event of a fraught two-day trip to Ireland which has been dominated by the issue of sexual and institutional abuse.

During his 36-hour visit, the pontiff was repeatedly forced to address the decades-long scandal that has had a catastrophic impact on the church’s reputation and moral authority in Ireland and elsewhere.

The most significant statement came in a penitential prayer said at mass in Phoenix Park. The pope listed specific forms of abuse, including sexual crimes, vulnerable women being forced by nuns to undertake manual labour, and forced or coerced adoptions. Each request for forgiveness was welcomed with applause from the crowd.

Facebook Twitter Pinterest Pope Francis leads the World Meeting of Families closing mass in Phoenix Park, Dublin. Photograph: Hannah Mckay/Reuters

The pope’s plea came as a retired Vatican diplomat demanded Francis’s resignation, claiming he had failed to act on abuse allegations against a prominent figure in the church hierarchy.

There was a “conspiracy of silence not so dissimilar from the one that prevails in the mafia”, archbishop Carlo Maria Viganò, 77, said in a highly charged 11-page testament. He claimed Francis knew Theodore McCarrick, the former archbishop of Washington, “was a corrupt man, [but] he covered for him to the bitter end”.

Later, during an in-flight media conference, Francis said Viganò’s document “speaks for itself” and that he would not comment on it. Francis said he had read the document and trusted journalists to judge for themselves. “It’s an act of trust,” he said. “I won’t say a word about it.”

'Hit-and-run' visit: Irish protesters reject pardon plea from Pope Francis Read more

Viganò’s testament followed a wave of revelations, reports and resignations to hit the Catholic church in recent months, which threatens to engulf Francis’s papacy and has provided ammunition for his enemies in the Vatican.

Celebrating mass in Phoenix Park, Francis said: “We ask forgiveness for the abuses in Ireland, abuses of power, of conscience, and sexual abuses perpetrated by members with roles of responsibility in the church.

“In a special way, we ask pardon for all the abuses committed in various types of institutions run by males or female religious and by other members of the church, and we ask for forgiveness for those cases of manual work that so many young women and men were subjected to. We ask for forgiveness.

“We ask forgiveness for the times that, as a church, we did not show the survivors of whatever kind of abuse the compassion and the seeking of justice and truth through concrete actions.

Play Video 2:34 Pope's visit to Ireland overshadowed by clerical child abuse scandal – video report

“We ask for forgiveness for some of the church hierarchy who did not take charge of these situations and kept quiet.

“We ask for forgiveness for all those times in which many single mothers were told that to seek their children who had been separated from them – and the same being said to daughters and sons themselves – that this was a mortal sin. This is not a mortal sin. We ask for forgiveness.”

Ending the prayer, Francis said: “Give us the strength to work for justice. Amen.”

Despite the long shadows cast over the visit, hundreds of thousands of people gave Francis a rapturous welcome at events in Dublin and at the Marian shrine in Knock in western Ireland on Sunday. A 3,000-strong choir and orchestra performed in Phoenix Park as Francis toured the waving crowds.

As well as Irish Catholics, including thousands who travelled from Northern Ireland for the event, the crowd in Dublin included about 20,000 pilgrims from all over the world attending the Catholic church’s World Meeting of Families, a global gathering held every three years.

Facebook Twitter Pinterest An aide adjusts Pope Francis’ cape as he speaks at the Knock shrine. Photograph: Peter Morrison/AP

Although 500,000 tickets for the papal mass were allocated, the Vatican estimated the crowd at 300,000 and other estimates were lower.

The crowd was, however, far smaller than the 1.25 million who came to see Pope John Paul II celebrate mass in Phoenix Park in 1979, and aerial shots showed large empty spaces. Strong winds and heavy rain on Sunday morning may have been a deterrent. The Say Nope to the Pope campaign had urged people to request tickets and then not attend as a form of protest.

Jim and Betty O’Neill were celebrating their 52nd wedding anniversary at the mass with their two grandchildren, having set off from Belfast at 7am. “Pope Francis is very humble. I’ve been very impressed by his demeanour. I have an awful lot of time for him,” said Jim O’Neill, 72.

“I would have loved him to have come north. A lot of people there are very disappointed, but it’s great to be here,” he said.

Saoirse Mooney, 15, from Balmaley, said she was proud to be a Catholic. She thought Pope Francis was “a very nice man, he seems to be all he’s cracked up to be.”

Facebook Twitter Pinterest Pilgrims listening to the pope. Photograph: Niall Carson/PA

As Francis led people in prayer, survivors held protests elsewhere. Thousands of people turned out in support in Dublin’s Garden of Remembrance, and a vigil was held at the site of a mass grave discovered at a mother-and-baby home in Tuam, which contained the remains of almost 800 infants.

Survivors of abuse had been determined to ensure that the pope left Ireland with a deeper understanding of the trauma they have suffered and their visceral anger at the church’s complicity and cover-up.

The papal visit to a country where Catholicism was once ingrained in the national psyche but which has changed almost beyond recognition in recent years had uncomfortable moments.

Francis heard Ireland’s taoiseach, Leo Varadkar, call for a new relationship between church and state in which religion was no longer at the centre of society in a speech delivered at Dublin Castle on Saturday.

He also spent 90 minutes meeting with eight abuse survivors on Saturday. After hearing their accounts, Francis described the cover-up of abuse as “caca”, or excrement, according to one of those present.

Second day of Pope Francis's visit to Ireland – in pictures Read more

Marie Collins, another of the survivors who met Francis, said he had told the group he was not planning new measures to hold bishops who cover up abuse to account.

“In answer to [my] question of setting up a tribunal and what sort of concrete measures there’s going to be, it would appear that there’s not going to be anything more,” Collins, who last year resigned from the Pontifical Commission for the Protection of Minors, told the National Catholic Reporter.

“The pope said there are already tribunals being held and bishops are being held accountable before them.”

Collins said she also asked Francis why the church allowed disgraced prelates to resign instead of being sacked. Bishops should not be permitted to “just walk away and resign, as if it was by choice”, she said.

At his last meeting before leaving for Rome, Francis returned to the theme of abuse. “A recurrent theme of my visit, of course, has been the church’s need to acknowledge and remedy, with evangelical honesty and courage, past failures with regard to the protection of children and vulnerable adults,” he told bishops at the Convent of the Dominican Sisters.

“In these years, all of us have had our eyes opened to the gravity and extent of sexual abuse.”