LONDON — British tour company Thomas Cook collapsed early Monday after failing to secure emergency funding, leaving tens of thousands of vacationers stranded abroad.

The British government said the return of the 178-year-old firm’s 150,000 British customers now in vacation spots across the globe would be the largest repatriation in its peacetime history. The process began Monday and officials warned that delays are inevitable.

The Civil Aviation Authority said Thomas Cook has ceased trading, its four airlines will be grounded, and its 21,000 employees in 16 countries, including 9,000 in the UK, will lose their jobs. The company several months ago had blamed a slowdown in bookings because of Brexit uncertainty for contributing to its crushing debt burden.

The company had said Friday it was seeking 200 million pounds ($US 248,744,000) to avoid going bust and was in weekend talks with shareholders and creditors to stave off failure. The firm, whose airliners were a familiar sight in many parts of the world, also operated around 600 UK travel stores.

The company’s chief executive, Peter Fankhauser, said in a statement read outside the company’s offices Monday morning that he deeply regrets the shutdown.

“Despite huge efforts over a number of months and further intense negotiations in recent days we have not been able to secure a deal to save our business,” he said. “I know that this outcome will be devastating to many people and will cause a lot of anxiety, stress and disruption.”

Britain’s CAA said it had arranged an aircraft fleet for the complex British repatriation effort, which is expected to last two weeks.

“Due to the significant scale of the situation, some disruption is inevitable, but the Civil Aviation Authority will endeavor to get people home as close as possible to their planned dates,” the aviation authority said in a statement.

Describing the repatriation plan, British Transport Secretary Grant Shapps said dozens of charter planes, from as far afield as Malaysia, had been hired to fly customers home free of charge. He said hundreds of people were staffing call centers and airport operations centers.

British travel expert Simon Calder told Sky News that Thomas Cook’s problems started in 1994 when the “open skies” agreement allowed upstarts easyJet and Ryanair to flourish. At the same time, he said, the internet became widely used for travel bookings, lessening the demand for Thomas Cook’s travel agencies.

“There’s still of course a place for travel professionals, there’s a place for the package already, as companies like Jet2 and TUI are demonstrating, but Thomas Cook was behind the curve and I’m afraid with high costs such as those expensive high street premises they simply couldn’t cope,” he said.

Traveler Lucy Jessop from the eastern city of Hull said she had been scheduled to return from Mexico to Manchester with Thomas Cook on Tuesday and that the government had organized an alternative flight back to England.

“It’s the employees of Thomas Cook and all those due to go on holiday I feel for,” she said. “We were the lucky ones, I suppose.”

Unions representing the Thomas Cook staff had urged the British government to intervene to prop up Thomas Cook to protect jobs and the traveling public.

British Prime Minister Boris Johnson, traveling to New York for the United Nations General Assembly, said the government was right not to bail out the company, arguing that travel firms should do more to ensure they don’t collapse.

Johnson said bailing out the company would have established “a moral hazard” because other firms might later expect the same treatment.

“We need to look at ways in which tour operators one way or another can protect themselves from such bankruptcies in future,” Johnson said. “One is driven to reflect on whether the directors of these companies are properly incentivized to sort such matters out.”

Most of Thomas Cook’s British customers are protected by the government-run travel insurance program, which makes sure vacationers can get home if a British-based tour operator fails while they are abroad.

An earlier repatriation exercise following the 2017 collapse of Monarch Airlines cost the government about 60 million pounds.

Thomas Cook, which began in 1841 with a one-day train excursion in England and now operates in 16 countries, has been struggling over the past few years.

An estimated 1 million future travelers will find their bookings for upcoming holidays canceled. They are likely to receive refunds under the terms of the government’s travel insurance plan.

The company’s troubles were already affecting those traveling under the Thomas Cook banner.

A British vacationer told BBC radio on Sunday that the Les Orangers beach resort in the Tunisian town of Hammamet, near Tunis, demanded that guests who were about to leave pay extra money, for fear it wouldn’t be paid what it is owed by Thomas Cook.

Ryan Farmer said many tourists refused the demand, since they had already paid Thomas Cook, so security guards shut the hotel’s gates and “were not allowing anyone to leave.”

It was like “being held hostage,” said Farmer, who is due to leave Tuesday. He said he would also refuse to pay if the hotel asked him.

The Associated Press called the hotel, as well as the British Embassy in Tunis, but no officials or managers were available for comment.