By Margot Patrick and Patricia Kowsmann 

LONDON-- Goldman Sachs Group Inc. is squaring up for a fight with the Bank of Portugal over repayment of an $835 million loan made to Banco Espírito Santo weeks before the Portuguese lender's collapse.

The four-year loan, arranged by Goldman Sachs through a finance vehicle called Oak Finance Luxembourg SA, had been transferred in August to Novo Banco, the "good bank" carved out of Banco Espírito Santo. Last week, the Bank of Portugal decided that transfer was a mistake, and that the loan should instead remain at the "bad bank" that kept the Banco Espírito Santo name and its worst assets.

The decision means Goldman Sachs and its clients could lose hundreds of millions of dollars from investments in Oak Finance notes backed by the loan, since assets at the bad bank are estimated to be worth less than $100 million in liquidation. The Bank of Portugal's move also puts at a disadvantage junior bondholders at Banco Espírito Santo who are already embroiled in legal efforts to improve their own potential payout.

A Goldman Sachs spokeswoman said the Bank of Portugal's unexpected announcement would harm its clients and financial markets generally, and that it plans to pursue "all appropriate remedies."

Banco Espírito Santo failed in August after the central bank started untangling a web of cross-funding between the bank and other companies in the vast Espírito Santo family empire. The Bank of Portugal and the Portuguese prosecutor's office are currently conducting separate probes into the matter, and authorities in at least three other countries are investigating individuals and group companies over alleged wrongdoing.

The Oak Finance transaction stood out in the wreckage of Banco Espírito Santo, both for its timing and because of the companies involved.

As first reported by The Wall Street Journal in September, Goldman Sachs set up Oak Finance to help Banco Espírito Santo cover a financing agreement with China's Wison Engineering and Venezuela state energy monopoly Petróleos de Venezuela SA, or PdVSA. Wison Engineering had been hired by PdVSA for an oil refinery project in Puerto la Cruz on Venezuela's coast, and Banco Espírito Santo had provided PdVSA with letters of comfort, according to the prospectus for the Oak Finance notes.

Both Wison and PdVSA were themselves under strain as the deal was being put together. Wison warned this year that it could go out of business after its founder and controlling shareholder was caught up in a broad corruption probe by Chinese authorities. PdVSA has been trying to raise cash and is increasingly seen as vulnerable to defaulting on its debt because of worsening Venezuelan finances. PdVSA had also been identified as a major holder of debt issued by Espírito Santo companies, much of which is now worthless.

Oak Finance made the $835 million loan to Banco Espírito Santo in early July as the Portuguese bank was struggling to raise funding elsewhere. Oak Finance then issued $835 million in notes against the loan that were bought by Goldman and a set of its clients, including several hedge funds and pension funds.

Novo Banco was due to make its first payment on the Oak Finance loan, for $52.9 million, on Dec. 25, according to the Oak Finance prospectus. Under the terms of the deal, that money would have been used for an initial repayment to the Oak Finance noteholders.

"Four months ago, when Novo Banco was created, we sought confirmation from the Bank of Portugal that debts such as the Oak Finance obligations would be transferred to NB," the Goldman Sachs spokeswoman said. "On August 11, a senior representative of BoP explicitly confirmed to us in writing the transfer of these obligations. In addition, Novo Banco also confirmed in writing that Oak Finance had been transferred as one of its liabilities.

"The BoP's unexpected public announcement earlier this week to retroactively return these obligations contravenes market expectations and damages multiple investors, including pension funds, who were offered these investments in reliance on these prior representations," the Goldman Sachs spokeswoman said. "Absent the central bank's reconsidering its position in light of the damage it will be causing to our clients and financial markets, we plan on pursuing all appropriate remedies."

A Bank of Portugal spokesman on Monday said the Oak Finance decision was made to comply with European rules forbidding a rescued bank from taking on obligations to shareholders owning 2% or more of the entity. Goldman Sachs owned more than 2% of Banco Espírito Santo at the end of July, according to the spokesman and a filing that month by the American investment bank. The spokesman said the decision was announced to Oak Finance early last week after it was able to confirm Oak was indeed a Goldman Sachs vehicle.

Removing the Oak Finance loan boosted the balance sheet of Novo Banco, which is in the process of seeking a buyer, by 548.3 million euros ($666.5 million), according to a Dec. 23 statement by Novo Banco. The Wall Street Journal reported earlier Monday that at least four companies are interested in pursuing bids for the bank.

Write to Margot Patrick at margot.patrick@wsj.com and Patricia Kowsmann at patricia.kowsmann@wsj.com

Access Investor Kit for Banco Espírito Santo SA

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=PTBES0AM0007

Access Investor Kit for The Goldman Sachs Group, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US38141G1040

Subscribe to WSJ: http://online.wsj.com?mod=djnwires