Spanish Prime Minister Mariano Rajoy said Thursday that he was in talks with fellow European leaders about shoring up this nation’s troubled financial system, with a deal possibly taking shape behind the scenes that could see Madrid ultimately receive what some have dubbed a “bailout lite.”

Rajoy said at a news conference that he was waiting to determine how much cash the country needs to stave off a full-blown banking crisis before settling on a final figure needed to recapitalize Spain’s ailing banks. The International Monetary Fund is scheduled to give its estimate on Monday, though analysts said on Thursday that the amount appeared to be about $50 billion. Rajoy said he would also wait for the results of independent audits due later this month.

“After that I will give my figure, and the government will say what the system needs to be recapitalized,” Rajoy said during the news conference with Dutch Prime Minister Mark Rutte in Madrid. “I’ve been talking to my European Union colleagues, and to Prime Minister Rutte, to make a decision on this matter.”

Rajoy’s remarks came on a day of mixed economic news for a nation whose financial situation has become more and more urgent. Earlier in the day, the government in Madrid pulled off a successful bond sale only two days after officials warned that investors were closing the door to lending the nation more cash. But the strong showing was tempered later Thursday when the Fitch ratings agency announced it had downgraded Spanish bonds three notches — to BBB from A. Fitch cited the nation’s soaring debt and bank crisis for the action.

Hopes that Spain might be close to securing aid from the European Union eased market tensions during the trading day. Investors boosted stock markets across Europe, reflecting China’s decision to cut its key lending rate. But they also appeared to be taking heart in an emerging plan that could become a face-saving compromise between the German and Spanish governments.

Financial industry sources describe the plan as a smaller-scale bailout that could lend Spain an estimated $65 billion to $80 billion, significantly less than previous European Union rescues offered to Greece, Ireland and Portugal. Although the rescue funds would be channeled through the Spanish government, they would be earmarked strictly for the recapitalization of banks and could not be used to cover budget shortfalls, the industry sources said. Thus, Spain could potentially avoid many of the humiliating conditions — such as demands for independent auditors and more budget cuts — that were attached to other nations’ bailouts.

Such a proposal could be palatable to the Germans, who have opposed calls in Madrid to have European rescue funds pumped directly into Spanish banks. A direct intervention would have allowed Rajoy to avoid the embarrassment of going hat in hand for help only six months after coming to power. But German officials have argued that the action would violate the rules of Europe’s official rescue fund, which is designed to lend only to national governments.

German Chancellor Angela Merkel hinted Thursday that her country is ready to help via the bailout fund.

“It is important to emphasize once again that we have created the tools necessary to support the euro zone,” Merkel told reporters in Berlin after a discussion with British Prime Minister David Cameron. “Germany is willing to use those instruments whenever necessary. Our firmly expressed policy intent is to stabilize the euro zone.”

But directing rescue money for Spanish banks first through the hands of the national government is allowed under the European bailout fund’s bylaws. Giving the Spanish government further cover, the funds could potentially be transferred straight to a national account created to aid Spain’s banks, a shade of difference that highlights the political nuancing that has repeatedly complicated negotiations aimed at solving Europe’s 21 / 2-year-old debt crisis.

The compromise could, analysts say, provide short-term medicine for the continent’s crisis even as European leaders race to forge a new pact of medium-term bigger fixes that would include deeper economic integration and regional oversight of banks that could take months or years to develop.

“They need a solution now,” said one senior Spanish banking industry official who declined to be named given the sensitivity of the issue. “But we need a solution that also allows the government to save face.”

European officials were discussing the compromise and other options, according to sources familiar with the talks. The Spanish government and European officials are expected to wait at least several days before announcing a deal.

The Spanish government thinks the final report from IMF on the Spanish banking system will help provide an accurate statement of the amount needed by the country’s troubled financial institutions. Spanish banks are facing billions in toxic loans from the bursting of a U.S.-like property bubble, with the government last month moving to nationalize one of the nation’s largest banks, Bankia, after it said it needed $23 billion in fresh capital.

Some economists have estimated the total need for the Spanish banking system at $150 billion or more. Spanish banking executives have placed the need lower, between $50 billion and $85 billion. In a Thursday interview with TVE in Madrid, Antonio Lopez Isturiz, the general secretary of the European People’s Party, said Spanish banks may need as much as $126 billion in aid, Bloomberg reported. By comparison, Greece’s current bailout is costing about $172 billion.

A quick solution to Spain’s woes is considered crucial for avoiding a financial collapse in Europe’s fourth-largest economy that could have dire consequences globally. Publicly, however, Spanish and other European officials have been mum on any deal — possibly mimicking officials in Greece, Ireland and Portugal who also denied bailout talk while they were privately negotiating aid.

“I have absolutely not discussed any intervention in Spain’s banks today,” Spanish economic minister Luis de Guindos told reporters in Brussels after meetings with E.U. officials Wednesday. But the possibility of a deal helped Spain pass an important test on Thursday — the sale of $2.62 billion worth of bonds. Although the interest rates demanded by investors were higher than at Spain’s April bond sale, the relative success of the debt auction further calmed the market. That, analysts say, could quickly change, if there’s no bailout on the way.“The expectation is that the Spanish banks are going to get bailed out,” said Carles Vergara, professor of finance at Madrid IE Business School. “If that doesn’t happen, expect problems.”

Birnbaum reported from Berlin.