In roughly 45 minutes a crowd of people was allowed into Central Park to see Pope Francis View Full Caption DNAinfo / Anthony Izaguirre

MANHATTAN — They needed a miracle — and apparently got one.

Like Moses parting the Red Sea, city and federal officials avoided a disaster by opening the security floodgates to allow thousands of ticketholders to pour into Central Park in time to try to catch a glimpse of Pope Francis' processional along the West Drive Friday afternoon.

While the city might have dodged a bullet in Central Park, officials faced a similar problem outside Madison Square Garden, where Pope Francis is scheduled to celebrate Mass later in the evening.

A line of ticketholders there stretched down Seventh Avenue to at least West 24th Street with the pope en route.

Facing the prospect of leaving thousands of ticketholders lined up on Central Park West disappointed by missing the pope, the NYPD initially rushed to city schools and government buildings to find additional metal detectors to handle the crush of people, sources said.

After DNAinfo New York began to report that thousands might be shut out of the event, a City Hall official said they were "urging" security personnel to "make it work."

Racing against the clock, NYPD and federal officials made a last minute decision to rush thousands of the faithful into the park as the pope was heading to his popemobile. A line of more than 20,000 people vanished in less than an hour.

"All 80,000 people made it," a top law enforcement official told DNAinfo, breathing a sigh of relief.

It took nearly six hours for the first 40,000-plus ticketholders to gain entry to the park due to tight and thorough security where screeners were, for example, leafing through people's books to make sure there were no weapons concealed within the pages.

In addition to screening people entering the park, police officers are also struggled to move the crowd further along the processional route, sources said. Bottlenecks formed after the security checkpoints.

A city employee wearing a credential that read "Mayor's Staff" who was guiding spectators through metal detectors near Columbus Circle had lost faith that the thousands would get into Central Park in time.

"There's no way. It's too late," he said, declining to give his name. "All these people are getting turned away."

There were four screening points into the park, where authorites used 70 metal detectors to screen the throngs of Catholic faithful.

A spokeswoman for Mayor Bill de Blasio said the Secret Service was in charge of security for the Central Park event and for the pope's overall visit. She also confirmed that efforts were being made to speed up entry to the park.

New Yorkers obtained tickets through a lottery set up through City Hall and posted on its website.

Earlier this week, de Blasio said the city was ready to handle the 80,000 people expected in the park.

"It's going to be a joyous week, an exciting week, and it's going to be an inspiring week for New Yorkers as we welcome Pope Francis," the mayor said then.

With reporting from Anthony Izaguirre.

