The winding-up of Southern Cross, Britain's biggest nursing homes operator, has left Lloyds Banking Group and Barclays £50m out of pocket.

They have written off £30m and £20m respectively after coming under intense pressure from ministers not to pull the plug on the company.

A well-placed source said Lloyds and Barclays agreed to "swallow their liabilities" to avoid pushing the company into insolvency, which would have raised fears of patients being forced out of homes, creating a national scandal.

Lloyds, which is 41% owned by the British government following the taxpayer bailout in 2008, declined to comment. But a spokesman for Barclays said: "Our priority, at every stage, has been the continuity of care for the residents, and Barclays has made considerable concessions throughout this process."

The disclosure comes as Southern Cross prepares to de-list its shares from the London Stock Exchange in the new year. Shareholders and other creditors will receive nothing in the deal to stave off bankruptcy.

Southern Cross was financially poleaxed by having to pay a £250m annual rent bill at the same time as fees from local councils were falling, after they had been forced to make savings in the wake of the financial crisis.

The company said in the summer it was breaking itself up and handing back its 750 homes to landlords. The process is almost complete, with other operators taking over the homes and renegotiating rents. Southern Cross said only nine homes remained within the group. Completion is due within a fortnight, but de-listing will not happen until mid-January.

Southern Cross said: "We have worked closely with landlords to ensure the transfer of homes has been done with the absolute minimum of disruption to patients and their families."

The collapse of Southern Cross, which was once owned by US private equity group Blackstone, sparked a political storm and prompted Labour leader Ed Miliband to brand private equity houses as "asset strippers".

About a third of the former Southern Cross care homes are to be run as a joint venture between NHP – the company's biggest landlord – and Dr Chai Patel's care consultancy Court Cavendish. Patel is a former head of the Priory rehabilitation clinics, famous for treating celebrities with addiction problems.