Thousands of homeless families have been stuck in emergency accommodation for at least two years, The Independent can reveal. A chronic shortage of affordable homes in the capital is making it impossible for thousands of families to find a permanent residence so they can leave hostels or bed and breakfasts.

The housing shortage is affecting people around the country but the problem is particularly acute in London, where families are left struggling for years in cramped temporary rooms.

More than 4,000 homeless families in London (41 per cent) have been waiting two years or more to get a permanent home, according to data released by councils to Shelter under Freedom of Information laws. Of the London boroughs that responded to the FOI requests, more than half had families who had been waiting more than a year to get out of a hostel or bed and breakfast.

Campbell Robb, chief executive of Shelter, said: “It’s appalling that in one of the wealthiest cities in the world, there are forgotten homeless children, hidden from view in temporary accommodation that offers them no stability and can be unsafe and in poor condition. And sadly, with more people struggling to make ends meet, we’re bracing ourselves for an increase in demand from families who desperately need our help.”

B&B or hostel accommodation is only supposed to be used by councils in the very short term, when a permanent home cannot be found. But an investigation by Labour last year found the borough of Westminster spent almost £85,000 a week housing families in 10 hotels, costing almost £4.5m a year. The study found the use of B&B accommodation to house homeless families for more than six weeks – the legal limit – had risen by 800 per cent since the Coalition took office.

Shadow communities minister Lyn Brown said: “Labour will tackle the housing crisis by getting 200,000 homes a year built by 2020, legislating for stable long-term tenancies for private renters so families can have peace of mind, and we’ll scrap the cruel bedroom tax which puts families at risk of homelessness.”

The Housing minister, Brandon Lewis, said: “Councils have a responsibility to house families in settled accommodation as quickly as possible and we have given them the tools to do this, including strengthening their powers to provide quality privately rented accommodation and providing more than £1bn to tackle homelessness and to support people affected by welfare reform.

“The numbers of households in temporary accommodation is well below the peak reached under the previous administration, which hit 101,000 in 2004. Households now spend on average eight months less in temporary accommodation than at the start of 2010.”

However, the Government’s claim is based on records of people leaving temporary accommodation – whereas Shelter’s figures show the numbers who have not even managed to leave.

Case study: ‘When i needed help, it wasn’t there’

Louise Walker, 38, is a full-time mother living in Ealing, west London

When my husband and I separated, he left the home we shared and stopped paying the mortgage.

The house was repossessed and when I got the eviction order in April 2012 the council told me and my four children – now aged five, eight, 10 and 16 – to stay with family or friends while they tried to find me somewhere to live.

We stayed with my friend for just under a year. In March 2013 they found a B&B for us to stay at. There was one bedroom for all five of us to sleep in.

We were sharing a floor with another lady and her daughter. There were two rooms, a communal area, and a kitchen and a bathroom, which we shared.

When they moved out another family moved in. There was a husband, a wife and four sons. The youngest was 14 and the oldest was in his 30s.

I was very concerned as a single woman with all these men. I have three daughters and my son has special needs. I didn’t feel safe.