NEW YORK (AP) _ A federal judge Friday cleared Delta Air Lines of driving Pan American World Airways out of business three years ago and ordered Pan Am to repay Delta about $150 million.

Pan Am had sought $2.5 billion from Delta, claiming the Atlanta-based airline had forced it to shut down by withholding the last bit of financing needed to finish Pan Am's bankruptcy reorganization.

''We fulfilled all our obligations to Pan Am and even went the proverbial extra mile in providing assistance in the reorganization effort of Pan Am,'' said Delta chairman Ron Allen.

U.S. District Judge Robert Patterson Jr. also ordered Pan Am to repay $115 million Delta lent Pan Am during its bankruptcy. Delta said that as of June 30, the interest bill totaled $30 million.

The loan dictated an interest rate of 2.5 points above the prime rate, meaning at least $6 million in interest has accumulated in the past six months.

The news was welcomed on Wall Street, where Delta's stock price finished at $49.625 a share, up $3.875, in New York Stock Exchange trading.

Pan Am general counsel Paul Rendich described the decision as ''a loss across the board for Pan Am.'' Rendich said Pan Am wouldn't decide whether to appeal until attorneys had a chance to study the decision.

Pan Am shut down days after Delta said it wouldn't put up any more money to carry it through a bankruptcy court reorganization. Since it stopped flying, Pan Am has been selling assets and pursuing lawsuits to raise cash to pay creditors.

After selling its Washington-New York-Boston shuttle operation and its North Atlantic routes to Delta, Pan Am hoped to emerge from bankruptcy court as a smaller carrier flying between Miami and Latin America.

Pan Am claims Delta had said repeatedly it was planning to invest in the new Pan Am on Dec. 4, 1991, but reneged. Pan Am had been budgeting its cash to last until that day and when Delta backed out, Pan Am ran out of cash and shut down.

But Patterson ruled that none of the written agreements between the two or Pan Am's proposed reorganization plan indicated the deal would close on that day.

''To contend that ... not only flies in the face of the language of the joint plan of reorganization, but would require the court to find that Delta and its very experienced attorneys were grossly stupid,'' Patterson wrote.

Although the reorganization plan was to be confirmed on Dec. 4, Delta said it had always planned to wait 10 days - the customary period to allow for appeals - before deciding whether to invest in the reorganized Pan Am.

Delta lawyers argued during the trial that what was left of Pan Am was failing quickly and that the business could use up Delta's investment in a matter of months.