The two principal owners of United Press International yesterday fired the company's president and then announced they are willing to give up their control of the financially troubled news organization if a rescuer can be found to take it over.

Amid a management upheaval signaling a new financial crisis for the wire service, owners Douglas R. Ruhe and William E. Geissler announced yesterday that Luis G. Nogales, who had been named president only six months ago, and financial consultant Ray Wechsler were both fired. Three top executives, including UPI's comptroller and chief budget officer, then also resigned, apparently to protest Nogales' firing.

Nogales said he was dismissed in a dispute over how to structure a corporate refinancing package believed to be critical to UPI's survival. With the company still heavily in debt, Nogales said the company must work out an arrangement with its creditors soon.

"It sounds pretty bleak," Nogales said in an interview from California, where he had been negotiating with UPI's major lender. "I still think UPI can be saved, but I think the parties have to act very quickly."

In an official statement yesterday, Ruhe and Nogales said the wire service had earned a $1.1 million operating profit during the last three months of 1984. But UPI sources said yesterday the company is still saddled with $17 million in debt, making it difficult for it to find outside investors to infuse badly needed new capital.

Unfortunately, Nogales added, the publicity surrounding yesterday's shakeup is likely to make it harder for UPI to reach an agreement with its principal lender, Foothill Group Inc., and its other creditors. Foothill is a Los Angeles-based venture capital firm that has specialized in lending money at high interest rates to high-risk companies.

Ruhe did not return phone calls yesterday. But in a statement issued early in the morning, Ruhe and Geissler said they would be willing "to relinquish control" of the company in a program to recapitalize it and guarantee its future.

That statement is a reversal for the two Nashville businessmen who bought the wire service in 1982. Up to now, in their search for an outside investor, they have been willing to grant only a minority interest in UPI.

UPI sources said Ruhe and Geissler continue to be engaged in negotiations with Foothill, attempting to structure a deal to be taken to major creditors in which the creditors would be offered an equity position in UPI in exchange for forgiving the company's debts. Presumably, by the time all the creditors were issued equity for UPI's debts, Ruhe and Geissler no longer would maintain their controlling interest.

Nogales said that he had been trying to structure a similar deal before he was fired. "Where we disagreed was over how much stock they should retain, their continuing involvement in the operation and other conditions," he said.

A UPI story on the developments quoted sources saying that Nogales was fired after he objected to financial demands that Ruhe and Geissler were making in exchange for giving up their 90 percent ownership in the company.

According to the UPI report, those demands included a liability-free 25 percent interest in the reshaped company; $100,000 each in annual financial consulting fees, and sales commissions for one year if they could divest UPI of its radio service, business wire or domestic news picture service.

Nogales and Foothill found those demands "unsaleable" to the other creditors, the UPI story said. Nogales was negotiating at the home of John Nickoll, president of Foothill, on Sunday night, when Ruhe called and fired him, the story said. The story also said that UPI owes Foothill $5 million to $7 million in revolving debt and leases. The debt is at above-market interest rates, the story said.

Geissler, in an interview with UPI, said the report over the two owners' financial demands was "out of context." "We obviously entertained discussions on details of this alternative," Geissler was quoted as saying. "It would not be productive to comment on specifics, but rest assured our decision will be conditioned on achieving our primary purpose: the strengthening of the UPI service."

Nogales said yesterday that negotiations with Foothill had begun earlier this year after it became clear that Ruhe and Geissler had been unsuccessful in a three-month attempt to bring in new investors.

One major stumbling block, according to several UPI employes, has been Ruhe and Geissler's insistence on maintaining majority control of the company. Another problem, according to Nogales, was Foothill's concern over the amount of debt UPI was carrying. He declined to say how much money was involved, but noted that "it became a drain on our ability to operate the company. At that time we decided -- with the approval of Ruhe and Geissler -- to recapitalize the company."