Ministers said they had decided to stick with housing benefit to pay for what is known as supported housing after listening to views from local authorities and campaign groups.

A separate plan to replace housing benefit for elderly people in sheltered accommodation with a new “sheltered rent” scheme has also been dumped.

“Protection of the most vulnerable has always been our primary concern, and following our consultation, the case for keeping supported housing in the welfare system became clear,” said Housing Minister Kit Malthouse.

Media playback is unsupported on your device

Campaigners had warned that cash-strapped councils council target emergency accommodation for savings, despite a government pledge to ring-fence the grants, and that refuges would be forced to compete with other providers.

They were also concerned about how support would be funded across local authority boundaries for people trying to get away from abuse at home.

Women’s Aid had warned that almost 40% of its refuges, which offer emergency living accommodation to women so they can escape domestic violence, could close.

Its chief executive Katie Ghose said the latest announcement would be “warmly welcomed” by survivors of domestic abuse.

David Orr, chief executive of the National Housing Federation, added: “This is a hugely welcome decision that shows that government has listened to the concerns of housing associations and the people who use these vital homes and services.

“After years of uncertainty, we are delighted that housing costs will remain in the social security system for all supported housing, sheltered and extra care.”

Shadow housing minister Sarah Jones said the government had “finally listened”.

“Thousands spoke out against these ill-conceived proposals for supported housing funding which would have left some of our most vulnerable people without a safe place to stay.”