UPDATE 2-Spain extends maturities on state-backed loans to help companies hit by pandemic

* Approves banks’ code of good practice for debt restructuring

* Voluntary write-offs to be implemented on 3 bln euros of debt

* Plan also includes participatory loans to be converted into capital (Adds details on loan moratoria and write-off schemes)

MADRID, May 11 (Reuters) - The Spanish government on Tuesday extended the maturities of state-backed loans to up to 10 years and allowed lenders to prolong loan moratoria beyond the current two years as part of a package to help mid-sized companies weather the pandemic.

Spanish companies have been among the most active in Europe in seeking credit, mobilising a total of 126 billion euros ($153 billion) in state-backed credit and liquidity lines, which until now were slated to last up to eight years.

The cabinet also on Tuesday approved a code of good practices that banks are encouraged to implement under a previously announced 3 billion euro debt restructuring plan, government spokeswoman Maria Jesus Montero told reporters.

The code is part of a wider package of 11 billion euros in relief measures approved by the government in March to help firms cut excess debt and boost solvency.

As in other European countries the focus has been switching to solvency issues from liquidity, and Spanish companies will also be able to apply for participatory loans, a hybrid debt instrument that can be converted into capital.

Under the code of good practices, Spanish banks will apply voluntary write-offs of existing state loans as part of debt restructurings for firms whose revenues fell at least 30% in 2020 compared to 2019.

The write-offs should be implemented as a measure of last resort under the losses scheme set by each loan received from the state credit agency, the ICO, but banks must say if they want to adhere within a month.

As part of the ICO’s loan scheme, the state guarantees around 80% of unpaid loans to small and mid-sized companies and 70% for bigger ones.

In a statement, Spain’s economy ministry said that banks and companies must reach an agreement to renegotiate all the outstanding debt, guaranteed and non-guaranteed, in order to benefit from the relief measures.

Write-offs can rise to up to 50% of the guaranteed loans, if a company or self-employed person’s 2020 revenue fell by less than 70% in 2020, and up to 75% of the guaranteed amount if the decline is wider than 70%, the ministry said.

This public-private framework will stay in place until December 2022. (Reporting by Jesús Aguado; additional reporting by Emma Pinedo; editing by Andrei Khalip and Susan Fenton)