* Spanish banks reluctant to write off corporate loans
* ECB tests likely to expose problem loans across euro zone
* Hedge funds want to buy corporate debt at deep discount
* Some funds lend to firms rejected by banks - at high price
By Sonya Dowsett
MADRID, Oct 23 (Reuters) - Hedge funds are circling Spanish banks, hoping to mop up bad corporate debt cheaply when the lenders finally face up to billions of euros in losses on loans to firms in trouble.
Spanish companies are among the most indebted in Europe, and investors say that only when this burden has eased will equity buyouts recover following the country's long recession.
While Spanish banks have already been forced to grasp the nettle on property loans, they still need to tackle their distressed corporate lending. Investors say the banks must accept selling these loans for much less than their face value, taking what is known as a "haircut".
That pressure rose on Wednesday when the European Central Bank announced plans to put euro zone banks, including 16 from Spain, through rigorous tests next year that aim to unearth any risks hidden on their balance sheets.
Funds see a chance to buy up these bad loans at deep discounts, or to carry out high-interest "rescue" lending to Spanish firms that can no longer borrow from the banks.
"Spain has not yet reached a point at which banks are prepared to take a haircut on corporate loans," said one Madrid-based private equity investor. "I've yet to see a Spanish bank selling at an 80 or 90 percent discount."
Nevertheless, investors believe a wave of corporate loan deals is about to start.
"You are going to see a lot of these transactions to reset debt levels," said one U.S. private equity investor who spoke on condition of anonymity. "I see that as a trend coming up now before you see real equity going into Spanish companies."
Regulators have turned the spotlight on to Spanish banks' bad loans to companies and homeowners following the massive writedowns last year on soured real estate assets dating from a property crash that began in 2008.
While Spanish bankers may still have a deep aversion to taking losses on corporate lending, the Bank of Spain told them earlier this year to be stricter when classifying bad loans.
Already the Spanish government has had to take European Union help in refinancing banks after their property losses, and analysts expect next year's ECB exercise to show a number of euro zone lenders need to raise more capital.
Euro zone bank shares fell 2.5 percent after the ECB announcement, with Spanish lenders down 4 percent on average. Bankia led the decline, losing over 5 percent.
Spain, which is on the brink of recovery after the 5-year slump, has high levels of private sector debt compared with countries such as Italy and Germany. Corporate and household debt amounts to 207 percent of economic output, according to Morgan Stanley, compared with a European average of 165 percent.
Spanish banks have 257 billion euros of corporate loans on their books, not including real estate and construction companies, with just under 50 billion of that in arrears, according to Bank of Spain data.
The banks are reluctant to roll over many of their corporate loans and are seeking ways to cut their exposure.
Hedge funds in particular have been looking to buy up corporate debt on the cheap to turn a profit by holding the loans in the hope of eventually recovering more than they paid.
Alternatively, they could force a debt restructuring which might allow them to take equity in return for writing off the loans. Other types of investors are thinking up new types of deals, including charging a premium to lend to companies rejected by the banks.
U.S. private equity giant Kohlberg Kravis Roberts agreed a 320-million-euro, 7-year loan with construction materials manufacturer Uralita in April which allowed the firm to repay bank creditors and bondholders.
"Our banks wanted out. Refinancing, for us as well as them, seemed like a phase that had run its course," said Uralita board member Javier Gonzalez. "We had been dragging out a tense relationship for many years."
Uralita got many approaches from foreign private equity firms, with five looking to draw up a deal with similar terms. KKR Asset Management, wholly owned by KKR, was the only fund to offer a pure debt deal with no obligation to hand over equity eventually.
"We were surprised at how much interest there was," said Gonzalez. "It was clear funds really wanted to do a big deal in Spain."
He declined to say how much Uralita is paying for its loan, although he said it was around 2 percentage points more expensive than the firm's previous financing.
When seeking debt restructuring deals, investors are looking at companies that have been heavily discounted during the recession and are well placed for any pick-up.
The U.S. private equity manager described a typical target: "Everything that's related to infrastructure, consumer and media-related names. Anything that is leveraged to a recovery and has been discounted enough for people to go in," he said.
Spanish business is full of warning signs for private equity investors. Doughnut maker Panrico, owned by Oaktree Capital Management, filed for administration earlier this month; gaming company Codere delayed a coupon payment in September to debt funds Canyon Capital and GSO, as the firm tried to negotiate a restructuring against the clock.
Many investors have had to cut their losses and bail out from deals made in the boom years, such as Carlyle Group and Vista Capital which sold debt-laden tour operator Orizonia to Globalia in December at a fraction of what they paid in 2006.
Private equity investment in Spain is at its lowest since the start of the economic slowdown, data from the Spanish Association of Risk Capital shows, more than halving in the first six months of this year from the year-ago period to 483 million euros.
Funds are reluctant to invest in the equity of companies whose earnings, hurt by the recession, are too low to pay off the huge debts accrued during the boom years.
"Any investor that wants to do a deal has to first sit down with the banks and reach an agreement for them to write off some of the debt to such an extent that the company can reasonably repay loans with the earnings they make," said private equity specialist Francisco Martinez at law firm Cuatrecasas.
Funds and lawyers say it is often the international banks in a syndicated loan to a Spanish company which are the first to accept a heavy discount so they can liquidate their investment and move on.
"They are sooner than later going to have to accept discounts on these loans. There's no doubt about it," the U.S. private equity investor said.