One day in October, Rena Dubin got a call saying her teenage daughter, who has Asperger’s syndrome and an anxiety disorder, had a panic attack so severe it caused her to run from her school building in Reisterstown, Md., and toward a busy road.

Confused and delusional, the girl was taken to Northwest Hospital in nearby Randallstown, the closest emergency room, where her mother hoped she would be swiftly transferred to a hospital that accepts adolescents for psychiatric inpatient treatment.

Instead, they waited. For nearly 24 hours, the daughter lay on a gurney in Northwest’s emergency department. Finally giving up, the Dubins checked the teenager out and drove her to Johns Hopkins Hospital. There, they waited in the emergency department for another day until Hopkins staffers tracked down an inpatient bed at Children’s National Medical Center in Washington.

“We just felt like we were in a holding pen,” Dubin said. “I was the one taking care of her in the ER, but the whole reason we brought her to the hospital is because we feel like we need help.”

The Dubins’ experience is an increasingly common one nationwide for psychiatric patients. The “boarding” of mental health patients in hospital emergency departments is a widespread problem that experts say is on the rise, in part because of cutbacks in inpatient hospital beds.

As states trimmed their budgets in the economic downturn, resources for mental health patients were among the casualties. Twenty-eight states and the District reduced their mental health funding by a total of $1.6 billion between fiscal 2009 and 2012.

Virginia, for example, eliminated funding for 19 acute care beds at the Northern Virginia Mental Health Institute in Falls Church in 2010, reducing the total from 129 to 110, though 13 have been restored through temporary funding. Restoring all19 beds permanently would cost $1.4 million a year.

Maryland lost 145 — or 12 percent — of its public psychiatric beds between 2005 and 2010, and Virginia lost 252 of its beds, or 15 percent, according to a 2012 report by the Treatment Advocacy Center, a nonprofit mental health group. The nonprofit says Maryland and Virginia have a “severe” bed shortage, with 12 to 19 beds per 100,000 people. The District wasn’t part of the report, but its mental health department said it increased its bed count by about 20 percent over the past three years, in large part because of the reopening of St. Elizabeths Hospital.

Meanwhile, more and more people are turning to emergency rooms for health care nationwide. ER visits increased by 32 percent from 1999 to 2009, and overall ER wait times for all sorts of ailments have also gone up, according to a Centers for Disease Control and Prevention report. Psychiatric patients make up 7 to 10 percent of emergency room visits, said a 2012 study in the Emergency Medicine International journal.

For many patients suffering from psychiatric crises, this translates to longer waits in emergency departments, where they receive no treatment for days — and sometimes weeks — while social workers try to chase down open spots in psychiatric wards, doctors said.

Jeff Sternlicht, chairman of emergency medicine at Greater Baltimore Medical Center, said that years ago patients stayed in emergency rooms only a few hours but that now the average time for a transfer is 15 hours — and some stay as long as three days.

Almost every day, patients who are suffering from hallucinations or who have attempted suicide flood Sternlicht’s emergency department. One patient had to be physically restrained because he kicked and punched emergency room nurses during a psychotic episode, Sternlicht said.

“The ER department is designed for acute care,” Sternlicht said. “It’s far from the ideal place to be if you’re a psychiatric patient.”

Patients who have disabilities or special needs, conditions that frequently occur with mental illness, are especially hard to place. Joel Klein, vice chairman of the emergency department at Baltimore Washington Medical Center in Glen Burnie, said that anecdotally, the incidence of boarding has risen at his hospital in recent years, particularly for patients who require an inpatient room with grab bars, specially trained staff or other accommodations.

“Those patients often stay for multiple days waiting for a bed,” he said.

Insurance coverage, which sometimes pays for inpatient treatment at only certain hospitals, further complicates matters. Heather Carpenter of Baltimore rushed her 15-year-old son to Medstar Franklin Square Medical Center in that city when he attempted suicide in May. But even though Franklin Square had beds available, he was boarded overnight because her insurance network included only hospitals with unavailable beds.

Data on the length of stays for each state aren’t centrally kept, but a patchwork of surveys and reports reveals a growing trend. A 2010 survey of 603 hospital emergency department administrators by the Schumacher Group, an emergency-room consultancy, found that 56 percent of emergency departments are “often unable” to transfer behavioral patients to inpatient facilities in a timely manner. More than 70 percent of administrators reported waits of at least 24 hours, and 10 percent had boarded patients for a week or longer. In 2007, 42 percent of hospitals surveyed by the American Hospital Association reported an increase in psychiatric boarding.

Waiting for hours or days in an emergency department can worsen a severe mental health crisis, experts say.

“In some ways, the worst place on the planet for these folks is an ER. There’s sensory overload,” said Peter Paganussi, an emergency physician at Reston Hospital Center and a former president of the Virginia chapter of the American College of Emergency Physicians. “Emergency doctors are trying to put out fires they can see, and in these patients, there are fires that smolder inside.”

Inpatient treatment involves close monitoring by psychiatrists and hours of group and individualized therapy each day. In the emergency department, patients with a psychiatric crisis may get only their standard medications and a sedative.

Lingering psychiatric patients can also impede the flow of emergency rooms, taking up space and distracting doctors with the demands of finding inpatient beds. One January 2012 study found that, nationally, psychiatric patients remain in the emergency department 3.2 times longer than non-psychiatric patients, preventing an average of 2.2 additional patients from accessing care during their stay and costing the emergency department an extra $2,264 per patient.

Local health agencies are attempting to alleviate the problem by making it easier for emergency-room liaisons to find inpatient beds. Virginia and Maryland are rolling out Web sites that will track psychiatric beds in real time, which they hope will be an improvement on the current practice, in which hospital workers call each psychiatric facility one by one to check on bed availability.

Although the Web sites may help, they won’t entirely resolve what some doctors say is the larger issue for psychiatric patients: There’s often nowhere for them to go.

“Our biggest problem is a lack of bed capacity,” Sternlicht said.

The Dubins’ emergency-room saga resulted in a successful inpatient stay for their daughter, but they said they think the experience is likely to repeat itself.

Johns Hopkins declined to comment on the case specifically, but a spokeswoman said in an e-mail: “Providing the best possible care in the most efficient manner possible is our primary goal. Recognizing there is always room for improvement, we encourage our patients and families who feel we haven’t met these goals to contact us.”

Suzanne Harrison, the director of psychiatry for Northwest Hospital’s parent company, said Northwest is increasing its adult bed count by nine this year but acknowledged that there is a “national shortage of inpatient beds” and that patients with psychiatric emergencies tend to wait in the ER four to five times longer than other patients there.