The number of homeless families put up by councils in bed and breakfast accommodation has risen by almost half, according to an analysis of official figures. The rise comes after ministers warned 20 councils not to house families in B&Bs for six weeks or more.

The National Housing Federation, which represents housing associations, found that between January and March 2011 there were 2,750 families nationwide living in B&Bs. In the same period in 2012 this had risen to 3,960, an increase of 44%.

The federation also says the number of homeless families is increasing, pushing up demand for "emergency temporary accommodation" (B&Bs). In the past two years, the number of households accepted as homeless has risen by 10,000 to 50,290.

The problem is acute in inner London, where the government's policy of capping housing benefit has caused thousands of families to approach councils to help cover the shortfall between rent and state subsidies. Westminster council said it now had more than "1,150 households approach for advice and assistance due to the local housing allowance (LHA) cap. In July, 141 households approached for advice, an increase of 27 on the previous month."

"We believe the rise in acceptances is the result of the LHA caps and a high proportion of applications coming from families who are unable to find alternative accommodation, who we are required to accept through homeless legislation," the council said.

Because of the shortage of affordable properties for low-income people, many are being exported out of London. According to Westminster, "in the last month we have secured properties in Hemel Hempstead, Bletchley, Maidstone and Grays" to house the homeless.

The federation says this sort of temporary accommodation is preferable to B&Bs, which lead to poor people having no security of tenure. However, it warned that from April 2013, families living in these homes could be hit by another cap which limits the total amount of benefits paid to households to £500 a week.

"As [homes in the private rental sector] become more expensive to rent and manage, this could mean families are unable to pay the rent – pushing them back into B&Bs, or even on to the streets," it said.

The government has not yet confirmed how the benefit cap will affect people living in temporary accommodation and what measures will be taken to protect the service.David Orr, chief executive of the National Housing Federation, said: "In a B&B, whole families can find themselves sharing one room and they are often shut out of their accommodation during the day, causing huge disruption to daily routines of school and work. Every child deserves a decent home to come back to after school, where they feel secure, and where they can sit down to do their homework. That is what temporary accommodation provides.

"Without the safety net of temporary accommodation, thousands more families will find themselves in a vicious cycle of homelessness.

"It is essential that the government puts in place measures to protect this crucial service and the vulnerable families who depend on it."

Mark Prisk, the Tory housing minister, said: "There is no excuse for any family to be stuck in bed and breakfast accommodation, and we have offered support to those 20 councils who between them account for 80% of families in this situation for an unacceptably long time.

"We have some of the strongest protections in the world to safeguard people from homelessness, and levels remain lower than in 28 of the last 30 years. Councils have a range of options at their disposal to help anyone facing the threat of losing their home, and to help them further we've increased the discretionary housing pot to about £400m over the spending period to help families with the transition to the new, fairer system of benefits."