Pope Francis has urged the faithful who gathered for the biggest event of his US visit to be open to "miracles of love", closing out his joyful six-day trip with a message of hope for families, consolation for victims of child sexual abuse and a warning to America's bishops.
Philadelphia's Benjamin Franklin Parkway overflowed with the jubilant, who stood in line for hours and endured airport-style security checks to see history's first pope from the Americas celebrate an open-air mass in the birthplace of the United States.
The mass - the last major event on Francis' itinerary before the 78-year-old pontiff boarded a flight home to Rome - was a brilliant tableau of gold, green, white and purple in the evening sunlight of a mild early-autumn day.
Riding through the streets in his open-sided popemobile, the pontiff waved to cheering, screaming, singing, flag-waving crowds and kissed babies as he made his way to the altar at the steps of the columned Philadelphia Museum of Art.
With a towering golden crucifix behind him, Francis told his listeners that their presence itself was "a kind of miracle in today's world", an affirmation of the family and the power of love.
"Would that all of us could be open to miracles of love for the sake of all the families of the world," he said.
Crowds a mile away fell silent during the communion part of the mass. Some people knelt on the paving stones at City Hall, a few streets from the altar.
June Bounds, 56, of Rochester, New York, said: "It's very overwhelming. You feel like you're one body with everyone here, whether you're here, whether you're back home, whether you're anywhere in the world.
"He's (the Pope) brought so much joy and holy spirit into the United States. It doesn't matter if you're a Catholic; he's just trying to unite everybody for a better world."
Organisers had predicted one million people would attend the mass. There was no immediate estimate of the crowd. But some people got tired of waiting in line and gave up, while others may have been scared away altogether by the heavy security and weeks of dire warnings from the city about the potential disruption.
Train travel was lower than expected, hotel rooms went unfilled over the weekend, normally bustling city streets were deserted, some businesses closed early, and many Philadelphians complained that the precautions were oppressive.
Earlier, Francis had a more solemn message for families scarred by the sins of the church itself.
The Pope met five victims of child sexual abuse and told them he was "deeply sorry" for the times they came forward to tell their stories and were not believed. He assured them that he believed them and that bishops who covered up for abusers would be made to answer for what they did.
"I pledge to you that we will follow the path of truth wherever it may lead," Francis said in Spanish. "Clergy and bishops will be held accountable when they abuse or fail to protect children."
Minutes later, he went into a meeting of bishops from the US and around the world who were in town for a Catholic festival on the family and told them the same thing.
"God weeps" over what was done to the youngsters, he lamented.
The Pope has agreed to create a new Vatican tribunal to prosecute bishops who failed to protect their flock and he has accepted the resignations of three US bishops accused of mishandling abuse cases.
During his first meeting with victims, held at the Vatican in July 2014, Francis similarly vowed to hold bishops accountable, but this marked the first time that he had warned the bishops themselves, face to face, and in public.
But victim support groups were unimpressed by the meeting, at a seminary on the edge of Philadelphia. The main victims' support group, Snap, dismissed it as an exercise in public relations.
"Is a child anywhere on Earth safer now that a pope, for maybe the seventh or eighth time or ninth time, has briefly chatted with abuse victims? No," said Snap's David Clohessy.
As the mass drew to a close, church officials said the next World Meeting of Families, the Vatican-sponsored festival that brought the Pope to Philadelphia, will be held in Dublin in 2018.
Ireland is ground zero for the church's sexual abuse crisis outside of the US. The overwhelmingly Catholic country also recently legalised gay marriage.
Francis' journey took him first to Cuba, then to Washington and New York. Along the way, he drew large and adoring crowds, met President Barack Obama, visited ground zero and a school in East Harlem, and addressed Congress and the United Nations, calling for urgent action on climate change and poverty.
He also pointed to a new direction of the US church, twice praising the service of America's nuns, who had been subject to a recently ended Vatican crackdown, and urging America's bishops to focus more on helping their flock through life's ups and downs rather than spending all their energy on culture wars.
Francis also visited a Philadelphia jail to give hope of redemption to about 100 inmates, included suspected killers, rapists and mobsters. He greeted the men one by one, telling them to use their time behind bars to get their lives back on track.
The blue-uniformed inmates, some of them heavily tattooed, appeared moved. They clasped Francis' hands, and two gave him a hug.
During the meeting with the bishops, Francis referred to gay marriage for the first time in his US trip, lamenting the new reality in which Christians must live. But he warned that a church that does nothing but explain its doctrine was "dangerously unbalanced".
The US bishops have spent considerable time and resources battling gay marriage, calling its legalisation by the US Supreme Court three months ago "a tragic error" and "profoundly immoral and unjust".