MEXICO CITY - Long the darling of the world's emerging markets, Mexico became an international pariah almost overnight after a botched devaluation last December sent the country's currency plunging and investors fleeing. Many analysts here say privately that the country might have slipped into virtual bankruptcy were it not for a $50 billion aid package from the United States and the International Monetary Fund earlier this year. Mexican banks were especially hard hit during the crisis. With the peso's value cut in half, many saw their dollar-denominated borrowings double in cost. Nonperforming loans swelled as interest rates skyrocketed. And after the country found itself essentially locked out of the international capital markets, some banks simply buckled, unable to meet the tight new capitalization requirements imposed by the Mexican government. Now, the Mexican economy is emerging from its languor with the peso stabilized and inflation in check. Since the devaluation last December, the peso has appreciated more than 35%, and the Mexican equity markets have risen 25% - leading some bankers and analysts to predict that the country's banking sector is poised for a comeback. "I believe the economic crisis has hit bottom in Mexico," said Juan Marco Gutierrez Wanless, executive vice president and chief financial officer for Banco Mexicano. "What we need to do now is to restore confidence not only with the public but with investors." Some experts have said that after an initial wave of bank interventions and consolidations earlier this year, Mexican banks seem to be emerging stronger than before, in part because of government aid packages that have made it easier to obtain fresh capital and restructure past-due loans. In May, the Mexican government brokered an agreement for a takeover by Spain's Banco Bilbao Vizcaya of the ailing Mexican bank Probursa. The deal called for Bilbao to inject $350 million of fresh capital into the bank, while Mexico agreed to buy $300 million of Probursa's bad loans. The transaction was seen as a template for the recapitalization of other banks experiencing liquidity problems, which were intensified by high interest rates - at times exceeding 100% - and the deepening recession. At one point this summer, past-due loans exceeded the entire capitalization of the Mexican banking system. Smaller banks like Probursa, Banca Cremi-Union, and Banpais were hit harder by the economic crisis than their larger counterparts. But they were by no means alone. The country's four largest banks - Banco Nacional de Mexico, Bancomer, Banca Serfin, and Banco Mexicano - have all had to scramble to meet new capital requirements and stem portfolio problems. In June, the government agreed to take over problem loans from Banca Serfin, Mexico's third-largest bank, in return for a commitment from shareholders to recapitalize the bank. It became apparent that Serfin would have to be rescued after its problem loans rose 83% to $1.9 billion, or 12% of its total loan portfolio, for the year ended in March. "Last year we wanted our capitalization ratio to be the highest of the big Mexican banks," said David Royo, director of financial planning for Serfin. "But then the devaluation came in the middle of the party, so to speak." Grupo Financiero Serfin, the bank's parent company, agreed to inject $350 million of capital into the bank, while the government purchased $817 million of nonperforming loans. The bank also raised $200 million in an equity offering and $155 million more in a convertible bond issue, Mr. Royo said. Despite the strengthening, Serfin saw earnings drop to $21.7 million in the second quarter, 23% below the first quarter and 45% below the year- earlier level. But most banking analysts agree that earnings would have been far worse if the bank had not entered the government's recapitalization program. Mr. Royo traced the bank's loan problems to the early 1990s when Serfin helped finance a slew of toll-road projects that have yet to be completed. Now nonperforming loans represent only 6.5% of the bank's loan portfolio, he said, and the number is expected to drop as Serfin restructures many of its remaining bad loans. The recapitalization program that helped Serfin was the first of several aid packages the government presented to fortify the country's financial system. In April, the government repackaged the loans so that borrowers deemed viable before the devaluation could pay back their loans at lower interest rates. But the program has been slow to catch on with banks, and only some very large loans have been restructured. For the small-time debtor, relief came this August when the government set lower ceilings for interest rates on credit cards, consumer and commercial loans, agricultural loans, and mortgages. The rate caps could affect a quarter of the loans in the entire banking system - about $18.3 billion. The package came in response to rising discontent from Mexican debtors socked by high interest rates and sharp declines in buying power since the devaluation. As of June, loans past due accounted for 12% of all loans in the system. Under the program, debtors who restructure their loans will be pardoned for past-due fees and begin paying the loans back at the new lower interest rates. The government will pay banks back at the Mexican interbank rate plus 2% for the loans. The difference between that and the market rate on the loan will be absorbed by the bank itself. The Ade program, as it's known, is expected to cost the government $1.5 billion, or 3% of gross domestic product. The banking system would make up the rest of the cost, paying out $1.7 billion to $1.8 billion. But some analysts have said it is not clear whether the banks will benefit from the new program. "We expect that the system's largest banks will at least break even, if not profit from the Ade program," said Jose A. Garcia Cantera, a banking analyst with Salomon Brothers Inc. in New York. But he added that the country's two largest banks - Banamex and Bancomer - will benefit much more rapidly because they are relatively stronger in the marketplace and have access to cheaper sources of funding than their counterparts, Serfin and Banco Mexicano. "The Ade program will have a great impact because it basically halves the debt burden that many Mexicans find themselves under today," said Hector Rangel Domene, director general of Bancomer. "It will cost us money, we know, but it's very reasonable and it causes incentives to build a culture of regular payment" among Mexican debtors. Mr. Rangel, who helps oversee Mexico's second-largest bank, said he expects the current aid effort to cost Bancomer $333 million. He said it should be seen as "a one-time effort" to get the economy on track. Salomon's Mr. Cantera estimates that 55% of Banamex's nonperforming loans would have to become current for the bank to break even. Bancomer is in a similar situation; it needs 58% to become current. But Serfin and Banco Mexicano would have to restructure 86% and 75% of their nonperforming loans, respectively, to reach a breakeven point - figures he said were unlikely. Mr. Gutierrez of Banco Mexicano does not dispute Mr. Cantera's assessment, but he added: "The banks are willing to sacrifice some of their interest margin in order to achieve balance. Realistically, I would say that we could restructure 50% of our (nonperforming) loans. But I don't mind taking a hit because of the reserves I won't have to create." There has also been talk for quite some time that Banco Mexicano - Mexico's fourth-largest bank - would be acquired. Bank officials make no secret of the fact that they have been holding talks with Bancomer for a possible buyout. But Mr. Gutierrez said the bank had other options,