--Caixabank, Popular, Banesto hit by real-estate loss provisions

--All three set aside most of their profit against losses

--Portugal's BCP bank swings to loss, takes EUR502.2 million hit from Greek operations

--Spain has lifted minimum loss provisions level twice this year

MADRID--One large and two mid-sized Spanish banks reported sharply lower second-quarter profits Friday after setting aside billions of euros to cover real-estate-related losses amid a deepening economic slump.

In neighboring Portugal, meanwhile, Banco Comercial Portugues SA (BCP.LB) said it swung to a net loss in the first half of the year after recording impairment charges for its Greek unit and souring domestic loan book.

Caixabank SA (CABK.MC), Spain's third-largest lender by market value, number five bank Banco Popular Espanol SA (POP.MC) and smaller Banco Espanol de Credito SA (BTO.MC), all said Friday they had set aside most of their profit to bolster their buffers against property sector losses, after the government twice this year raised the minimum required provisioning level for banks.

Caixabank said quarterly net profit tumbled 78% to 118 million euros ($145.1 million), while Popular's profit fell 37% to EUR75.4 million. Smaller Banesto, which is owned by banking giant Banco Santander SA (SAN), said quarterly profit sank 97% to EUR14.4 million.

In February Spain told banks they needed to bump up their provisioning levels on toxic real-estate assets by EUR50 billion, an attempt to appease investors worried about hidden losses in the country's banking system. But just three months later it became clear the market remained sceptical, so the government told banks to set aside another EUR30 billion to cover potential losses on developer loans that hadn't yet soured.

"The real-estate crisis is worsening and more developers are throwing in the towel," Popular's chief financial officer Jacobo Gonzalez-Robatto said, noting that many developer loans that earlier had looked doubtful now have gone into default.

In Portugal, souring loans are also increasing amid a deep economic contraction that began last year. BCP said 7.8% of its total loans were at risk in June, up from 5% a year earlier. The bank reported a EUR544.3 million net loss for the six months ended June 30 compared with a EUR114.3 million net profit a year earlier, after taking a EUR502.2 million hit from its unit in Greece.

The weakest Spanish banks are retrenching and allowing other lenders to charge more for loans. As a result, Caixabank and Popular said lending income grew faster than in recent quarters.

Banks are having an increasingly difficult time financing themselves among wary foreign investors, which is one of the reasons lending volumes in Spain are shrinking at a record pace. Banks, most of which rely heavily on financing from abroad, are scrambling to reduce this reliance by increasing deposits and cutting their exposure to troubled sectors such as the real-estate. "The country is deleveraging at quite a swift pace," Caixabank Chief Executive Juan Maria Nin said.

Adding to the problem, some banks see customers moving funds out of Spain amid worries about the country's increasingly dire financial situation. Mr. Gonzalez-Robatto said that some large companies have been doing that at the bank. "Many multinationals have withdrawn funds," he told reporters.

Cash-strapped Spain is waiting for the first part of a EUR100 billion aid package from the European Union, which will go towards cleaning up troubled banks. While most of the bailout money will go to the savings banks that have been nationalized, other large lenders are now being audited by Oliver Wyman to see just how much cash each individual lender needs.

Caixabank isn't expected to need additional capital in the test. Popular, which has a higher exposure to toxic real-estate, is working to raise money so it can avoid having to ask for bailout money.

Mr. Gonzalez-Robatto said Popular plans to raise about EUR800 million by selling assets, and another EUR700 million through a rights issue, which it plans to conduct in the first half of next year.

Portugal's BCP last month received EUR3 billion from the Portuguese government in exchange for contingent convertible bonds to meet capital requirements.

The so-called CoCos are sold as interest-bearing debt that has to be paid back. But they convert to equity in the event that a bank's capital ratios fall below certain levels.

Money for the bank was taken out of a EUR12 billion recapitalization line under Portugal's EUR78 billion bailout program.

(Patricia Kowsmann in Lisbon, Pablo Dominguez in Madrid contributed to this article.)

-Write to Christopher Bjork at christopher.bjork@dowjones.com

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