Spain's government says it will take control of the country's fourth largest bank and effectively nationalize it to shore up the nation's hurting banking sector.

The Economy Ministry says in a statement that €4.5 billion ($5.8 billion Cdn) in funding that Bankia SA received from Spain in 2010 and 2011 will be converted into shares of the institution's parent company.

Bankia faces the heaviest exposure among Spain's banks to bad property loans caused by a construction boom that went bust.

The decision announced Wednesday night came after investors sent Spanish government bond yields soaring and stocks plunging. They are concerned Spain may be forced to ask for a bailout like those taken by Greece, Ireland and Portugal.

Earlier Wednesday, Spain's financial markets were shaken as investors worried about the fallout from Greece's political crisis and awaited details of the Spanish government's next move to shore up its banking sector.

Spanish banks are largely frozen out of international capital markets and have been hobbled in their abilities to provide credit to businesses and consumers.

Banks crucial to Spanish recovery

That is crucial to help the Spanish economy out of its second recession in three years. The jobless rate is 24.4 per cent and GDP is forecast to shrink 1.7 per cent this year.

The yield on the benchmark Spanish 10-year bonds rose to 6.06 per cent, a jump of 0.28 percentage points on the day and uncomfortably high.

Bond yields indicate the rate the government borrows at when it taps financial markets. Rates of above seven per cent are seen as unsustainable, and forced Greece, Ireland and Portugal to ask for bailouts.

Investors worry that so much uncertainty could jeopardize the country's international bailout program, leaving Greece insolvent and even — in the worst-case scenario — abanding the euro currency bloc.

Such fears have caused turmoil in the financial markets of the weakest economies in Europe. Italy's stocks were down heavily, while the 10-year bond yield was up 0.21 percentage points at 5.57 per cent.

Bankia is key to the government's hopes of helping the sector because it is one of the most exposed to the imploded property market, with €32 billion in toxic real estate assets.

Its shares fell 5.8 per cent on Wednesday, its third straight day of heavy losses, while the broader market in Madrid closed down 2.8 per cent.