Delays in discharging patients from hospital while they are waiting for social care to be arranged are costing the NHS in England about £100 million each year, a documentary has revealed.
Professor Keith Willett, NHS England's director for acute care, tells Panorama that services need to be joined up, and that cuts in local authority budgets are making things worse.
Tonight's programme also looks at how the strain of working in accident and emergency departments are driving staff away, with one former consultant describing A&E as a "sinking ship".
Documentary makers spent a week filming at the emergency department of University Hospital of North Tees in Stockton, Teesside, where staff also spoke of the pressures of meeting "unachievable" targets to see patients within four hours.
Speaking of budget cuts, Prof Willett said: "There's bound to be a consequence. Social care and local authorities have taken a significant reduction. We need to join the services up and one of the key things we have to do is to bring the doctors, the nurses, the social workers back together.
"It's expensive for the NHS and it's wrong for patients to keep them in high acuity health care environments when they'd be much better off at home being supported in their own environments."
Prof Willet also condemned the target culture within the NHS as "too crude".
"Things have moved on," he said. "When it came in it was highly effective; now it's too blunt. It's really been a powerful weapon for change within A&E departments so it's not going to be got rid of without there being something that is better."
Alan Foster, chief executive of North Tees and Hartlepool NHS Foundation Trust, told the programme it was important for staff to remember that " behind every target is a patient".
"Patients come first," he said. "We don't want people to wait four hours in A&E. If you or I were going to the A&E department, we'd want to be seen quickly so although we have that target, it's not the be-all and end-all."
The documentary also speaks to Alex Muirhead, who worked as an A&E consultant at the hospital but left in December to work as a GP in Hartlepool.
She told the programme: "A&E is a sinking ship and, unless things change dramatically, it will sink because it's not a popular place to work now. "
Dr Clifford Mann, president of the College of Emergency Medicine, which represents A&E doctors nationally, said that recruiting and retaining enough emergency staff is a huge problem all over the country and warned that there could come a time when there will be no doctors to treat accident and emergency patients.
He said: "For the last three years, we've recruited only 50% of the registrars into emergency medicine. This means there's a lack of about 350-375 registrars around the country that equates to three quarters of a million patient consultations per year that can't happen because those doctors don't exist.
"My real fear if we don't do something about recruitment and retention in emergency medicine is that you will turn up in an ambulance to an emergency department and there will be no doctors there to see you."
Panorama calculated the £100 million figure using NHS England data from 245 trusts over the past two years.
A Week in A&E: Condition Critical? is on BBC1 from 8.30pm.
A Department of Health spokesperson said: " While the vast majority of patients continue to get excellent care in A&E, we know that the NHS is facing significant pressures. Since 2010, one million more people are visiting A&E and the NHS needs to change to cope with an ageing population.
"That is why we asked Sir Bruce Keogh to look at how the NHS should respond to demands for emergency services. We've already taken action to help the NHS cope with extra pressures this winter by investing an additional £400 million. In the longer term we are bringing back the link between GPs and elderly patients and investing £3.8 billion in joining up health and social care."