Like many of the immigrants who flocked to Spain not long ago, Klever Cordova was enticed by the prospect of easy employment and easy credit — the chance to leave behind the troubled economy of his native Ecuador and become a homeowner in a booming euro-zone country.

That was six years ago, before the collapse of the miracle that was the Spanish real estate market and the country’s slide into economic hardship. His job as a highway construction worker is long gone, and his $300,000 mortgage is now one more bit of straw in a load of bad debt that is weighing down Spain’s banks, undermining hopes of an economic recovery and raising new perils for the global financial system.

Spain’s debts can seem modest in comparison with some of the other countries such as Greece and Italy swept up in Europe’s financial crisis. Compared with the size of its economy, Spain’s government borrowed far less than most in the euro zone.

But the country’s financial system is heaving under the growing burden of bad real estate, development and mortgage loans. And if the banks lose their footing, many investors and economic analysts fear that the cost of saving the financial system will fall to the Spanish government, sending its own debts soaring.

Estimates of the amount needed by the banking system vary widely, from a few tens of billions of dollars to upwards of $100 billion — a number that would push Spain’s government debt into dangerous territory. Spain, the euro zone’s fourth-largest economy, is already facing steep borrowing costs. The government has to pay about 6 percent interest to persuade skittish investors to lend it money.

Spain has been under pressure by the International Monetary Fund and global investors to get out ahead of the mounting financial problems.

“The system needs a dose of realism,” said Jose Luis Suarez, a finance professor at the IESE Business School in Madrid. The banks “will have to have some form of public assistance.”

On Friday, Spanish officials are expected to announce what they hope will be a definitive plan, committing more public money to back the banking system. In particular, the effort would support a group of ailing “cajas,” local savings and loans that over a decade ago won permission to operate outside their home regions and began lending heavily to real estate development firms.

The plan could also require banks to clean up the books of their core banking operations by setting up separate businesses and then transferring to them loans made for land and development projects.

Officials took what was regarded as a major step this week when they signaled a virtual state takeover of Bankia, a conglomerate created by the merger of several ailing savings and loans that was labeled “vulnerable” in a recent IMF report. The developing plan for state help, and an IMF call last week for “swift and decisive” action by Spanish authorities, led to the departure this week of Bankia chief executive Rodrigo Rato, himself a former IMF managing director.

Details of the plan will be closely parsed in coming weeks to see whether it provides a real cure for the banking system’s problems. Outside analysts say Spain should err on the side of moving faster and spending more in order to sweep toxic debt out of the system.

Until the banks are fixed, local and international analysts agree, Spain’s economy will remain under a cloud. Investors will be reluctant to lend money, and local businesses and consumers will continue to struggle. Although a core of multinational companies are humming along nicely, helping to prop up the country, the overall economy is groaning under 25 percent unemployment, falling wages and high private debt.

Unlike the United States, Spain tried to limit the amount of public money used to prop up the banking system when the real estate market began collapsing in 2008. The hope was that banks would cover their own losses through future profits – on the assumption that the economy and property markets would rebound.

The process worked as intended in some cases. Two large firms – Banco Santander and BBVA – have earned so much from investments in Latin America they have been able to set aside capital as a buffer against the billions of dollars in bad Spanish property bets that are on their books.

The “cajas” are not so well positioned. These firms have struggled to restructure, write down the value of development projects to realistic levels and raise enough cash to cover the losses.

Spain’s banking system overall has about $320 billion in real estate, development and land loans outstanding. More than $180 billion is “distressed” – a sum equal to nearly 13 percent of the nation’s annual economic output. The amounts could rise as the country’s recession continues.

In the suburbs outside Madrid, half-built or half-occupied buildings have become a familiar sight. For-sale signs are common in the windows along some downtown streets. The boom years have left a glut of some 700,000 unsold homes — a supply that would take several years to eliminate at current sales levels.

At the offices of the Spanish Credit Institute, a government agency that loans money to banks to lend to small businesses, the signs of stress in the financial system are clear. The institute loaned about $8 billion in the year the crisis began. The sum has been exceeding $26 billion a year since then. Most of the loans, moreover, are now going just to help small firms with their cash flow — not, as they did in prior years, to finance investment in new equipment or trade or expansion.

“The ideal situation is we invest in productive activity,” said Francisco Javier Guinda, an executive with the agency. “Businesses are demanding liquidity.”

So far, the number of delinquent home mortgages in Spain actually remains low – fewer than 3 percent. But the recession and high unemployment could increase defaults, confronting the financial system with even greater losses.

Rita Smith recently wrote a letter to her bank, offering to return her apartment “in a much better condition” than when she bought it.

Smith moved to Spain here from Ecuador with her husband and daughter in 2004. She lost her job as an office secretary early in Spain’s economic crisis. Then, her husband was laid off from his job as an electrical engineer in January, when reforms kicked in making it easier for companies to downsize. She currently works part time as a gardener, but that job ends in a few weeks, and she’s not sure how she’ll keep up her $200,000 mortgage.

“I’ve become like a warlord. I control every cent,” Smith said. But that’s not enough, so she wrote to the bank.“I said starting next month, I can’t pay.”