PHILADELPHIA — Pope Francis urged hundreds of thousands of the faithful gathered Sunday for the biggest event of his U.S. 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.

The wide 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 took off on the 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 to the hushed crowd spread out along the tree-lined boulevard.

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 blocks from the altar.

June Bounds, 56, of Rochester, New York, watched with fellow parishioners on a large screen at City Hall, closing her eyes and blinking back tears.

Of the pope, she said: “He’s 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.”

Organizers had predicted 1 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 disruptions.

Train ridership was lower than expected, downtown 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 in the day, Francis had a more solemn message for families scarred by the sins of the church itself.

The pope met with five victims of child sexual abuse and told them he was “deeply sorry” for the times they came forward to tell their stories and weren’t believed. He assured them that he believes them and that bishops who covered up for abusers will 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 U.S. 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 U.S. 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 Sunday marked the first time that he warned the bishops themselves, face-to-face, and in public.In an apparent effort to reshape the discussion, though, the Vatican said not all the victims at the meeting had been abused by clergy; some were violated by relatives or educators. That underscored the Vatican’s argument that child molestation is not unique to the church.Victim support groups were unimpressed by the meeting, which took place at a seminary on the edge of Philadelphia and lasted more than a half-hour.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.The Rev. Tom Doyle, a former church lawyer who is now an advocate for victims, said that including those who were violated by non-clergy “seriously minimizes” the problem in the church.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 U.S. The overwhelmingly Catholic country also recently legalized 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 with 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 U.S. 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.Also Sunday, Francis 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 U.S. trip, lamenting the new reality in which Christians must live. But he warned that a church that does nothing but explain its doctrine is “dangerously unbalanced.”The U.S. bishops have spent considerable time and resources battling gay marriage, calling its legalization by the U.S. Supreme Court three months ago “a tragic error” and “profoundly immoral and unjust.”