One of Spain's most high-profile financiers, Rodrigo Rato, has resigned as head of Bankia just hours after prime minister Mariano Rajoy announced a major shake-up of the troubled banking sector.

Rato's surprise departure on Monday was seen as proof that ailing Bankia, which holds 10% of the country's deposits, was about to be rescued by the Spanish government.

Bankia now looks likely be the centrepiece of a fresh round of financial-sector reforms as Rajoy tries to boost confidence in a country that lies at the heart of the eurozone crisis.

Rajoy looked ready to backtrack on pledges not to use more public money on banks. "The last thing I would do would be to inject or lend public money, but if it is necessary I would not hesitate to do it, just as other European countries have done," Rajoy told a radio interviewer.

He was speaking as the financial markets attempted to digest the implications of the election of the Socialist François Hollande as president in France and the outcome of the Greek elections, where the formation of a government looked unlikely.

Rajoy said details of the shake-up in Spain would come after Friday's cabinet meeting, but there were rumours that a Bankia announcement would come sooner.

Bankia is at the centre of worries about the impact on Spanish banks of toxic real estate assets left over from a residential housing bubble that burst in 2008.

It is reported to need up to €10bn, which could come via Spain's own bank restructuring fund.

Bankia is reportedly going to borrow at 8% interest through a form of debt known as contingent capital, which turns into equity in times of stress – effectively becoming a part-nationalisation.

Rato had consistently maintained Bankia could continue as an independent bank and had no solvency or liquidity problems.

The creation of a "bad bank" for toxic real estate assets is another option being explored by the government, though Rajoy said on Monday that he did not like the idea.

There have also been rumours that the European Financial Stability Facility rescue fund could be used to prop up Spain's more troubled banks – which do not include the biggest two, Santander and BBVA.

Spanish banks escaped the subprime crisis after the central bank banned them from getting involved in riskier derivatives.

But they have largely rolled over the huge loans they themselves handed out to Spanish speculators, developers and construction companies in the boom years before 2008.

With land values plummeting and house prices also dropping dramatically, many developers have gone bust and banks have been caught out.

Rather than pull the plug on building projects, however, they have often encouraged companies to finish off residential projects in a country where some 700,000 new homes are estimated to remain unsold.

The finished homes have been taken by the banks in place of unpaid loans, but analysts worry they have not owned up to the full drop in value of this vast stock of housing and often worthless building land.

Banks have some €320bn of property, with half labelled as problematic by the country's central bank. Some €32bn of those toxic assets belong to the Bankia group, which had recognised €12bn of losses on them.

Bankia is the result of the merger of seven regional savings banks, which were the most reckless lenders during the housing boom.

The government has already spent €18bn cleaning up the country's financial sector. Dozens of savings banks have been forced into mergers and banks have been told to recognise more than €50bn in losses on property loans and assets.

But a February bank reform failed to convince markets that Spain, which has slumped back into recession and is suffering 24% unemployment, had solved the problem.

Spain's banks as a whole have until 31 May to say if they need to merge with other entities under the February reform plan.

Austerity measures aimed at slashing the government deficit from 8.5% to 3% of GDP over two years have helped tip Spain into recession – increasing the likelihood of banks also having to deal with a flood of mortgage defaults.