MANILA, Philippines — When the pope comes to town a big bill awaits the host country, but the mammoth crowds whipped up by the Roman Catholic Church leader also offer plenty of good business.

In pope-adoring Philippines, which hosted the pontiff for a five-day visit that ended early this week, a massive logistical effort tested the resources of a country that has lagged others in East Asia in tackling corruption and extreme poverty.

The government deployed 50,000 police and troops, nearly a fourth of its forces, to ward off any threats, keep ecstatic crowds that numbered an estimated 6 million at their peak from mobbing Pope Francis, and to prevent stampedes and crimes.

State forces are thinly spread even under normal circumstances as they deal with communist and Muslim insurgents and other threats. Officials say the bulk of the forces had to be brought into the capital from provinces. Money was spent for their accommodation, transportation, food and allowances.

Officials, however, are not yet giving a price tag. Presidential spokesman Herminio Coloma said Thursday the cost to the government was not yet clear, with data from various agencies still being gathered.

A member of the central committee that organized the visit said government could have spent at least 200 million pesos ($4.5 million) on security and physical arrangements, including barriers that walled off the 11-kilometer (6.8-mile-long) route from the air base where Pope Francis's plane touched down to the Vatican's diplomatic mission in Manila. The official did not want to be named because he was not authorized to speak to the media.

How much the church spent, and collected in donations, is also unknown.

Archbishop Socrates Villages, president of the governing body of bishops and priests in the Philippines, said they are still paying bills and have not yet finalized their accounts. The biggest expenses, he said, were the giant LED screens and speakers put up at Rizal Park, where a rain-soaked final mass was held, and other venues.

"It feels good to be a Filipino," Villegas said. "The whole world watched us for five days while Pope Francis was here, and we delivered the best."

But for business, there were winners and losers. Hotels, restaurants and souvenir vendors did brisk trade. But the outsourcing, semiconductor and finance industries were among the losers.

Hans Sicat, president of the Philippine Stock Exchange complained about the declaration of three work days as holidays in metropolitan Manila, coming after the long Christmas break.

It was an honor for the Philippines to be visited by the pope, he said, but the holidays "create all sorts of logistical issues for individuals and companies, with certain businesses required to shutdown, or worse, suddenly have a higher cost for getting people to work."

When the central bank is closed the banking system cannot clear funds, forcing the stock exchange to close as well, he said.

The government also loses out from extra holidays, Sicat said, because it collects a tax on every stock trade that amounts to 4.5 million pesos ($100,000) on an average trading day.

A report by the Makati Business Club, which groups prominent executives, estimated that 20 public holidays last year cost the outsourcing industry, which employs more than a million people, 19.3 billion pesos ($438 million) in extra employment costs such as holiday pay. On that basis, three extra holidays in Manila would cost tens of millions of dollars. The industry, which serves customers around the world, can't shut down on Philippine holidays. Similar costs were also incurred by the semiconductor and electronics industry.

Airlines, meanwhile, had to cancel dozens of flights because Manila airspace was declared a 'no-fly zone" hours before the arrival and departure of Pope Francis' aircraft. But Transportation Secretary Jose Emilio Abaya said he did not expect substantial losses because flights are rebooked anyway.

Hotels on the fringe of Manila Bay, near most of the papal visit venues, were almost all fully booked even if they charged higher rates.

Vanessa Suatengco, general manager of the Diamond Hotel that housed the Vatican-accredited media, bishops and one of two media centers, said only their 210-square-meter presidential suite that costs $2,839 a night was not occupied out of the hotel's 500 guest rooms.

It was one of the best weeks for the hotel in terms of earnings, she said.

"There was a mad rush for rooms even if we were selling them for high rates," Suatengco said. "And of course the best thing that happened for us was that every day during the presscon, in the backdrop that they made, Diamond Hotel was there, so it was all over the world."

Getting similar global exposure were two low profile carriers: SriLankan Airlines, which flew the pope to Manila from Sri Lanka, the first leg of his visit to Asia, and Philippine Airlines. The Philippine national airline flew Pope Francis from Manila to eastern Tacloban city and back, and ferried the pope, his delegation and media back to Rome.

Budget Secretary Florencio Abad said "a lot of money" was spent by the government but the Philippines is likely to benefit from a higher international profile that will get another boost when it hosts a summit of Asia Pacific leaders in November.

"The gains far outweigh the cost," he said.