The fire brigade has warned four NHS trusts that they plan to shut down parts of their hospitals because they are so decrepit that they pose a threat to patients and staff.

Fire chiefs have made plain to the trusts that they must make urgent improvements to the units concerned in order to improve safety or face legal action to close them down.

The Care Quality Commission, the watchdog that inspects hospitals and GP surgeries, is also considering using its powers because it fears infrastructure problems risk affecting patients.

Management at the four trusts are worried about the disruption to services if the fire brigades follow through on their warnings. They blame multibillion-pound government raids on the NHS’s capital budget in recent years for creating a situation where they have been left without the money to fix worsening problems with hospital buildings such as broken lifts and leaks of water and sewage. Capital funding is used to repair NHS facilities, buy new equipment and build premises.

Chris Hopson, the chief executive of NHS Providers, which represents trusts in England, warned that the problem was now so great that patients’ safety was at risk. He was unwilling to identify the four trusts, but said: “A number of trusts have told me that they are worried they are running an unacceptable fire hazard risk and several have said they don’t have the capital to comply with the terms of formal Care Quality Commission enforcement notices.

“Over many years of austerity, trusts have had to hold back from buying new scanners, replacing ageing wards, repairing leaking roofs and purchasing new ambulances. They’ve scrimped, saved, patched up and made do, but we’ve now reached a crisis point.”

In the past year, one trust has suffered multiple floods because of crumbling pipework, another has had to close its intensive care unit because water was running down its walls, and a third cancelled appointments for cancer diagnosis because its ageing scanner broke down.

The overall bill facing the NHS in England to tackle its backlog of maintenance shot up from £5.5bn in 2016-17 to almost £6bn in 2017-18, including £3bn needed to tackle problems that involve a “high” or “significant” risk, of which more than £1bn are problems posing a high risk.

Trust bosses have become increasingly frustrated about ministers diverting money from the NHS capital budget to help pay for its day-to-day running costs.

NHS England has told them to spend 20% less than they planned on capital projects this year in order to help Matt Hancock’s Department of Health and Social Care stick to its departmental spending limit. Senior staff at the trusts privately say the order is “ludicrous” and is stopping NHS organisations that do have enough capital funding set aside to spend on projects that are now urgent, including fire risks.

The Epsom and St Helier NHS trust in Surrey calculated last year that it needed to spend £93m to urgently prevent the increasingly archaic facilities at its two hospitals from becoming so out of date that they presented a threat to the smooth running of its services.

The CQC is understood to have told the trust that it will take enforcement action against its intensive care unit unless it urgently addresses problems identified more than a year ago, which have not been tackled because it does not have the £3m needed to cover the cost.

Prof John Appleby, an expert in NHS finances at the Nuffield Trust health thinktank, said ministers transferred £4.3bn from the service’s capital budget to its revenue budget between 2013-14 and 2018-19. “We’ve now had many years of the NHS investment pot being siphoned off just to keep day-to-day services running and the problems are multiplying,” he said.

“Maintenance gets put off or skimped on, leaving a rising backlog of leaky roofs, broken lifts and worse. The repair bill to sort all this out is already a sobering £6bn and rising. Purchases of the latest equipment are also being delayed, leaving the health service lagging behind other countries.

“There can be no doubt that all this is getting in the way of safe and effective care. The budgets cut back are supposed to cover IT costs, too, undermining the high-profile push for a more digital NHS. I don’t think we can go on like this much longer.”

NHS England declined to comment. Its chairman, Lord Prior, recently asked the government to provide up to £5bn a year in capital funding over the next 10 years through a new bond. However, Philip Hammond, the chancellor, was not keen on the idea, Prior admitted.