NEW YORK, Jan. 10 -- A federal bankruptcy judge tonight approved Pan Am Corp.'s proposed sale of its valuable London routes to United Airlines as part of a deal that will give the struggling carrier enough money to keep flying.

Pan Am had argued that without a quick decision on the route sale and an emergency financial package that goes with it, the carrier was on the verge of running out of cash and being forced to shut down its operations.

The decision brought to an end what had earlier threatened to turn into an all-out bidding war for Pan Am when three rivals showed up to express interest in the struggling airline's assets.

Lawyers for Los Angeles financier Kirk Kerkorian, Trans World Airlines Inc. Chairman Carl Icahn and Delta Air Lines Inc. all attempted to block the proposed sale of Pan Am's valuable London routes to United, telling the court that their clients might be willing to pay higher prices for some assets and thus provide more money for creditors.

But U.S. Bankruptcy Judge Cornelius Blackshear cut short those attempts by approving the United deal, saying he thought it was in the best interest of Pan Am, its employees and its creditors. Further delay, he said, could destroy the confidence of credit card companies and the traveling public in Pan Am.

As to the rival bidders, Blackshear questioned why they had shown up only today, when Pan Am had made public its deal with United last October.

At the first hearing on its future since filing for Chapter 11 bankruptcy protection Tuesday, Pan Am had urged Blackshear to let it sell its U.S.-London routes to UAL Corp., the parent of United, in a deal that includes $150 million in interim financing. The total package, which also involves a marketing arrangement between the two carriers, is worth about $400 million.

"We are grateful the court saw fit to take this action, both for the short-term benefits of the cash and also for the long-term benefits of the marketing agreement with United," said Pan Am spokesman Jeffrey Kreindler.

Without that stop-gap funding, the airline said it might run out of cash and be forced to shut down in a matter of days.

Despite such warnings, other parties crowded into the packed Manhattan courtroom had different ideas about how Pan Am's assets might best be parceled out.

Los Angeles financier Kerkorian and four of Pan Am's five unions said they might consider buying the carrier, providing Pan Am $50 million in emergency financing to keep it flying while they explored such a deal.

Mark Buckstein, general counsel to TWA, said his airline also was prepared to put up interim financing of $25 million. Before Pan Am filed for bankruptcy protection, TWA had proposed a merger of the two airlines but was rebuffed by Pan Am Chairman Thomas Plaskett.

Delta made no offer of interim financing but said it was prepared to pay a minimum of $50 million for a Los Angeles-Tokyo route that is part of the package that United Airlines has proposed to buy from Pan Am.

Blackshear's decision came despite a last-minute communication from U.S. Transportation Secretary Samuel K. Skinner, who said the judge could delay his ruling without endangering U.S. negotiations with the British government over transfer of Pan Am's routes to United.

The British government must approve the right of United, or any U.S. airline, to fly into London's premier airport, Heathrow. Currently, only Pan Am and Trans World Airlines have the right to fly into Heathrow under a bilateral agreement between the United States and the United Kingdom.

Pan Am only sought approval for $50 million of the financing deal today, which it said would allow it to continue operating until Jan. 25. Release of the rest of the loan is conditioned upon final government approval of the route sale, which Pan Am said it expected by then.