Peasant farmer Jose Lopez-Gregorio, 32, left his wife and five children behind in Guatemala with two bags of corn, barely enough food for one month, when he decided to find work in the United States. Detained crossing the Mexican border and held in an Arizona immigration center, he felt guilty, he told guards, eating three meals a day. Lopez had been inside one month and eight days when he strangled himself with a bedsheet. Five days earlier, the staff had placed him on suicide watch, only to be overruled within hours by the center's psychologist.

Mexican Carlos Cortes Raudel, 22, hanged himself from a tree on the way to breakfast in a California compound. Korean Sung Soo Heo, 51, was on suicide watch, less than a week after leaving a psychiatric hospital, when he hanged himself from a ceiling vent in his New Jersey cell. Geovanny Garcia-Mejia, 27, a Honduran, wrote notes in blood on his Texas cell floor and hanged himself from a ventilation grate while supposedly under 15-minute checks around the clock.

"It goes without saying that the incident could have been avoided," the Newton County sheriff noted in an internal review of Garcia's death.

While tens of thousands of detainees inside immigration detention centers endure substandard medical care, people with mental illness are relegated to the darkest and most neglected corners of the system, according to interviews and thousands of internal documents, including e-mails, memos, autopsy reports and other medical records, obtained by The Washington Post.

Doctors and nurses who often have difficulty detecting and treating physical ailments are having even greater problems managing the nuances of mental illness, documents and interviews show. Treating mental illness is a challenge in any context, but inside this closed, overburdened world, some psychiatric patients undergo months and sometimes years of undermedication or overmedication, misdiagnosis or no diagnosis.

The records reveal failures of many kinds. Suicidal detainees can go undetected or unmonitored. Psychological problems are mistaken for physical maladies or a lack of coping skills. In some cases, detainees' conditions severely deteriorate behind bars. Some get help only when cellmates force guards and medical staff to pay attention. And some are labeled psychotic when they are not; all they need are interpreters so they can explain themselves.

Suicide is the most common cause of death among detained immigrants. It accounts for 15 of 83 deaths since 2003, when the Department of Homeland Security's Immigration and Customs Enforcement agency, known as ICE, took over facilities for foreigners whom the government is trying to deport. Inside these out-of-the-way compounds around the country, suicide attempts seem to be on the rise, according to internal documents: 16 in June, 21 in July, 20 in August.

No one in the Division of Immigration Health Services (DIHS), the agency responsible for detainee medical care, has a firm grip on the number of mentally ill among the 33,000 detainees held on any given day, records show. But in confidential memos, officials estimate that about 15 percent -- about 4,500 -- are mentally ill, a number that is much higher than the public ICE estimate. The numbers are rising fast, memos reveal, as state mental institutions and prisons transfer more people into immigration detention.

The influx is overwhelming the system, internal documents show. The ratio of staff to mentally ill detainees is out of balance, with far fewer staff members than in other prison settings, according to Dennis Slate, the top mental health official in the detainee system. In an e-mail to colleagues the morning of last May 31, Slate said the ratio in the Bureau of Prisons was 1 to 400. In prisons for the mentally ill, it was 1 to 10. But in the immigration detention centers, it was 1 to 1,142.

Immigration authorities contract with a private facility in South Carolina to care for seriously mentally ill patients. They said they are considering several additional options for increasing care for such detainees.

Along with the crisis in care, the records also show soul-searching among doctors, nurses and administrators. "We need to stop looking for band-aid solutions for these problems," Slate wrote. "Step back, take a deep breath . . ."

It wasn't just patients that Slate and his colleagues worried about. They also worried that trading financial savings for substandard health care would come back to haunt the government. "Think about what we are trying to accomplish with limited financial and personnel resources we have," Slate wrote. "The little money managed care may save in the short run is going to be dwarfed by the millions that will be paid out by ICE when the lawsuits roll in."

None of these problems appeared overnight. When immigration became a national security issue after the terrorist attacks of Sept. 11, 2001, the administration decided to increase raids on workplaces for undocumented workers and to round up convicted felons who had served time but were now deportable, no matter how long they had lived in the United States. This, along with a new requirement that political asylum-seekers must wait out their cases behind bars, created a deluge that the system was unprepared to handle.

A system set up for quick stays turned into a de facto long-term care center for the most troublesome patients, those whose countries of origin often refused to take them, Slate noted in a confidential e-mail.

It was in this context that the basics of sound mental health care, such as proper supervision of suicidal detainees, were often overlooked.

On the evening of March 21, 2005, Gene Migliaccio, then director of the immigration health services agency, sent a brief BlackBerry message to colleagues: "DIHS is concerned that detainee committed suicide, in medical pod, after being assessed a suicide risk."

Hassiba Belbachir, a 27-year-old woman from Algeria, had strangled herself with orange jail-issue socks, which she knotted together and wrapped twice around her neck.

Five days before her suicide, Belbachir had a panic attack in her cell in an Illinois jail and was moved to a medical ward. The next day, internal records show, she told a social worker she was hearing "parasites and radio waves" and that she wanted to die. "Death is dripping, drop by drop," she said. But she was not placed on suicide watch.

Immigration officials declined to comment, citing ongoing litigation in the case.

Belbachir had arrived eight days earlier at Chicago's O'Hare International Airport. The youngest of seven children, she loved books on religion and dancing the merengue. With a degree in Spanish, she thought of becoming a translator. "She wanted to visit the world," said an older sister, Houaria Belbachir, who lives in France.

Belbachir had gotten married, and her husband had brought her to Chicago to live. After a month, she learned he had another wife. She fled to Spain, but without a visa, she was turned away at the airport. She flew back to O'Hare, asked for political asylum and, by federal policy, was taken into custody while authorities considered her claim.

Belbachir was sent to McHenry County Jail in the far suburbs of Chicago. The jail already had problems with its medical services: Detainees did not receive the required mental health screening, nor the standard screening for suicide risk, a recent review had found. Untrained staff members often did what screenings there were.

During Belbachir's intake screening, jail records show, she said she had tried to commit suicide once by drinking soap. The social worker who interviewed her noted that she had a "major depressive disorder" and needed to see a psychiatrist for medication. Belbachir was given an appointment for 6 p.m. on March 18.

By then, she had been dead for a day.

Investigation reports say a guard glanced into her cell at 3:40 on the afternoon Belbachir died. She was lying face down on the floor, but the guard could see only her lower back and legs. He asked a co-worker whether she "usually sleeps like that," and was told that she did.x

Half an hour later, when the guard returned to deliver dinner, he opened the cell door to discover Belbachir unconscious with the socks around her neck, her face purple, her mouth bloody.

She left a five-page handwritten poem, in French, on a paper with "Visa Waiver Program" across the top. It began: "It's good, the death."

Inside the detainee mental health system, treatment decisions often revolve around money. There are frequent battles, with doctors and nurses in the field on one side and the managed-care administrators in Washington on the other, looking for ways not to spend. The battles often prompt Solomonic choices.

One day, Slate and his colleagues engaged in an e-mail debate over a mentally ill detainee who was in the hospital but now well enough to leave. Should they send him to a detention center, where there was a bed available but no outpatient psychiatric care? Or should they keep him in the hospital, at greater cost, until space in a more appropriate immigration compound became available?

"We can not just leave these detainees in the hospital," insisted Linda Jo Belsito, the nurse in charge of managed-care decisions for DIHS. "Dr. Slate is advising leaving these detainees in-patient but I do not agree." Reached by phone, Belsito declined to comment.

Down the hall from Belsito's office at headquarters, Matt Kleiman, the head of behavioral health, strongly disagreed. Detainees such as these who are returned to the general prison population "will in all likelihood decompensate quickly," he warned, using a term that means to deteriorate psychologically.

Belsito and her managed-care associates were withholding treatment for many types of care, saving the agency millions of dollars. For mental health services, four denials for treatment of manic-depressive psychosis saved DIHS $18,145.36, according to an itemized record of the savings over a one-year period ending in August 2006. Two denials for care of "unspecified psychosis" saved an estimated $11,668.60. Nine denials for treatment of "depressive disorder not elsewhere classified" saved $43,158.57.

An immigration spokeswoman said the vast majority of requests are ultimately approved and the denials are usually because of insufficient information.

Money is not the only factor that determines the quality of care. Poor practices, records reveal, created a crisis situation at the South Texas Detention Complex at Pearsall, outside San Antonio.

On June 15, Gustavo Cadavid, chief of psychiatry for DIHS, waved a red flag after discovering that Pearsall's clinical director, Erik Johnson, had "close to 140 chart reviews" pending, meaning 140 patients still needed care. Cadavid had complained to headquarters several times about Johnson. "[I]t is becoming clear that there exist a crisis in the mental health care at Pearsall," he wrote in June.

Two hours later, Slate gave Cadavid some advice. "It is my suggestion that [medical director Timothy Shack] issue a clear order for Dr. Johnson to begin to provide treatment to mentally ill detainees," he wrote in an e-mail. "If he fails to follow the order, then this behavior needs to be interpreted as insolence and insubordination and documented as such."

Slate titled his e-mail "Crisis in mental health care in Pearsall." He copied it to seven top ICE and DIHS administrators, including the interim director of DIHS, Neil Sampson.

Immigration officials said the mental health care program at Pearsall meets national detention standards. Reached by phone, Johnson declined to comment. He is still at Pearsall.

The case of Junior Bannister, a detainee from Barbados, indicates that problems remain, as evidenced by another e-mail exchange.

When Bannister arrived at Pearsall in August, he told immigration officials that he had been taking Celexa, an antidepressant, for five years, since his young daughter died. When he was taken into custody, a top mental health official recommended continuing his medication, but his notes did not get scanned into Bannister's file.

Without his medication, he began having "auditory hallucinations." He complained often, and staff sent the concerns to Johnson, who never signed off on the prescription.

In January, a lawyer working with Bannister inquired about the delay, setting off a heated exchange between Johnson and his bosses, who discovered that the medical staff had seen Bannister 22 times.

Jay Sparks, officer in charge at Pearsall, sent a curt e-mail to Johnson on Jan. 11 after examining Bannister's medical records. "Now I am further puzzled. While I understand a shortage of medical staff, we evidently were staffed well enough to see this person 22 times, but in the course of all of this unable to get him the medication that had been recommended -- why would this be?"

Johnson replied 90 minutes later. "I could not get to him," he wrote. ". . . There are many things we are not able to get to."

Sparks e-mailed up the chain of command. "I believe this case illustrates that we need something more efficient," he wrote. ". . . If we need more medical staff, then they need to be deployed, but regardless of what the solution is, it needs to occur rather quickly, as access to adequate medical care for our detainees is a rather critical issue."

In a recent telephone interview, Bannister said he would try to get Johnson's attention whenever he saw him, without success. Johnson, he said, would dismissively "just wave his arms" every time. After eight months of asking, Bannister recently received his medication.

Isaias Vasquez was not as lucky. Three mental health workers at Pearsall misdiagnosed him and refused to allow him to continue taking medications that he had been prescribed much of his life. Immigration officials declined to comment, citing pending litigation.

Vasquez had come from Mexico to the United States legally with his family when he was 2 years old. He served in the Army for two years until psychiatric problems ended his military career. Years later, when he was convicted on a drug-possession charge, he served the 1 1/2-year sentence at a Texas state psychiatric hospital. The government said the crime made him deportable, and immigration officers picked him up from the hospital and sent him to one detention center, then another. Records chronicle his paranoid delusions and auditory hallucinations.

He had been diagnosed with chronic paranoid schizophrenia in the early 1990s and had been hospitalized 18 times before he landed in Pearsall. But the staff ruled that he was not schizophrenic and cut off his medication.

Instead, on Nov. 29, 2005, they diagnosed him with an "unspecified personality disorder." Vasquez "insisted throughout session he was paranoid schizophrenic and needed medication," a social worker wrote in his medical file. But the evaluation team concluded that "his thought process and content was normal, logical and coherent." They suspected he was faking to keep his Social Security disability benefits.

They decided to take him off a drug for schizophrenia, and another for depression, and cut his dose of a second antidepressant in half. The effects were swift. A week later Vasquez was placed on suicide observation. He "smeared feces throughout the suicide observation room," his medical chart shows. The next day, "he announced in the dormitory that either he killed himself or God would do it for him, and he took all of his clothes off. Then he got down onto the floor and licked it."

The staff's response: They eliminated the last of his psychotropic medicine. "Mental health visits will cease at present time," says a Dec. 15 note in his medical file.

Two months later, another note warned, "DO NOT PLACE YOURSELF WITHIN GRABBING OR SPITTING DISTANCE OF THIS DETAINEE."

After another month, he was found sitting on his bed with only a blanket around his waist, reading a Bible aloud and screaming, "The world is coming to an end, but not until I finish using my red tape!" He refused his other medications for diabetes, high blood pressure and suspected tuberculosis.

In mid-March, Johnson stuck a handwritten note on Vasquez's cell window: "If you keep refusing to take your . . . medicines . . . YOU put YOURSELF at risk of BLINDNESS, AMPUTATIONS, HEART ATTTACKS, KIDNEY FAILURE, STROKES and EARLY DEATH."

Vasquez "covered that area of the window with spit," Johnson wrote in his medical file. "I slid another copy under the door, and he turned it face down and slid it back out, and then he blocked the door with his clothing so I could not slide it under again."

On March 24, "[H]e had saved up 6 empty peanut butter jars and had some sort of yellowish liquid in them. . . . [T]he guards told him to give them up. He refused." The guards subdued him with tear gas.

They gassed him again two weeks later when he refused to give the guards the broken eyeglasses he had "tied to his head with an undershorts waistband. . . . When the room was repeatedly sprayed, he stood stoically."

Unable to persuade Vasquez to take his medicine, the staff discontinued it in late April. A final note on his behavior, from May 1, five days before his release, says he had "smeared feces on window to cell and threw water and feces under door of cell."

Even then, the staff did not reconsider its assessment that he was not schizophrenic or its decision to take away the psychotropic drugs. Their assessment of his problem: "Ineffective individual coping."

Vasquez had won his immigration case. When his common-law wife picked him up, she found him raving and gaunt. Gloria Armendariz drove him straight to the VA hospital. On the way, she recalled, "I had to cut the [car] speakers and put them in the trunk because he kept saying they . . . would listen and videotape him."

At the hospital, guards had to subdue him. He was admitted to the psychiatric ward, "which is where he needs to be," said his lawyer, Lee Teran. The next day, he was started on antipsychotics.

Helped by his medicine and no longer facing deportation, Vasquez, now 49, did something that, in his nearly five decades in the country, he'd never bothered to do: He applied to become a citizen. At the citizenship ceremony last fall, he wore a jacket, a tie and a broad smile.

While Vasquez had been denied crucial medicine, Amina Bookey Mudey had the opposite problem. Records show that she was diagnosed with psychosis she did not have and given medication she did not need.

Alone and speaking little English, the Somali woman arrived at John F. Kennedy International Airport in New York on April 11, 2007, seeking political asylum. With no interpreter to question her, immigration agents shackled her ankles, wrists and waist, and put her in a van.

Exhausted, hungry and frantic about being tied up, Mudey collapsed on the way to a windowless converted warehouse in Elizabeth, N.J., where she would remain for five months.

The Elizabeth compound also had no interpreter. Nonetheless, an intake officer wrote in her medical records that Mudey said she was epileptic. A doctor there diagnosed her with post-traumatic stress disorder, depression and, incorrectly, with psychosis. He prescribed the potent antipsychotic Risperdal.

Mudey, 30, was a member of an outcast Muslim clan and, according to her political asylum application, had been tormented by dominant groups throughout her life. When she was 10, she said, an old woman cut off her genitals with a razor blade. As a teenager, she was clubbed and beaten by girls with status. When she was 19, armed men shot and killed her father and two brothers at home. At 22, five men with guns gang-raped her mother and sister, who screamed so much the men killed her. Then they attacked Mudey with a knife and bashed her head with a gun butt.

Soon after taking Risperdal at the Elizabeth detention center, she found herself in the throes of its worst side effects. Her arms and legs shook uncontrollably. Her tongue thickened and thrashed around in her mouth, which she was unable to close. She drooled constantly, vomited often and began to lactate. "I said, 'Maybe I am going mad,' " Mudey said. " 'Maybe I am going to die in here.' "

When she lactated, her cellmates accused her of lying. " 'You must have killed your baby or had a late abortion,' they told me. 'You must be lying to us.' . . . Something was wrong. My breast was full of milk. They said to me, 'Are you sure you didn't leave a baby behind?'"

Mudey's symptoms were classic side effects of Risperdal, said doctors consulted by The Post. But when she complained, the detainee doctor only increased the dose. ICE initially declined to comment because of privacy issues. Last night, after those issues were resolved, the agency said it did not have enough time to prepare a response.

In her stupor, Mudey had her first court appearance. It did not go well. Her mind was a thick cloud; she was disoriented and unresponsive to questions. The judge was not impressed.

In June, Mudey was introduced to Ann Schofield Baker, a Park Avenue lawyer who specializes in high-stakes intellectual-property litigation and had volunteered for pro bono duty. After much haranguing, Schofield Baker managed to get an interpreter, psychiatrist and gynecologist into the compound to examine her client. They determined she had been misdiagnosed, according to court affidavits.

"She clearly has very severe PTSD and she is clearly depressed, but there is no evidence of psychosis," wrote Katherine Falk, the psychiatrist and a consultant for Physicians for Human Rights.

The two doctors wanted Mudey off Risperdal. "They just drugged the crap out of her," Laurie Goldstein, the gynecologist, said in an interview. "They just kept her slogged."

The doctors told her to refuse the pills. The compound's doctor scolded her when she did. She defied him.

"I told him that the other doctors says this other medication has been hurting me. I am not going to take it," she recalled in an affidavit prepared for court. "The first day I stopped taking it, I noticed I stopped drooling. In two or three days I could close my mouth. I was not as dizzy and confused. My appetite came back. I started feeling almost normal." Her mind regained its focus. Her next testimony was clear and more convincing.

But weeks later, Mudey experienced pain in her abdomen and back. She wrote notes to the doctor pleading for help. When she could no longer stand and lay balled up on her bed, her cellmates wrote notes for her. Weeks went by. She believed that the doctor was retaliating against her because she disobeyed him.

On orders of the doctor, but without an exam, a nurse gave Mudey Diflucan for a yeast infection, as Goldstein discovered after reviewing the few medical records that immigration officials would give her. After several consultations with Mudey by phone, Goldstein concluded that she was suffering from an acute urinary tract infection, a kidney infection or pelvic inflammatory disease. She tried repeatedly to reach the Elizabeth center's physician, but he would not respond, she said.

Schofield Baker prepared a legal injunction to force the Elizabeth compound to take Mudey to a hospital, and immigration officials relented. She got better quickly. She has no idea what was wrong with her or what drugs she was given; federal officials refused to give her the hospital records.

On Sept. 18, Mudey won her political asylum case. A guard told Schofield Baker that she could wait for her client in the parking lot across from the compound. Hours later, at 11 at night, Mudey's tiny figure appeared. She wore the same flip-flops and fuzzy coat she had on the plane when she first arrived in the United States.

"Seeing her walk out reminded me of a scene from the Holocaust," said Schofield Baker. "I was absolutely shocked and amazed we can treat human beings like this on our soil."

Mudey got into her attorney's rented Lincoln Town Car. It carried her down a road lined with barbed wire, past rows of gritty warehouses and hundreds of hulking trucks. Having not seen the sun or a star in the sky in the five months she had waited inside the windowless compound, Mudey was overwhelmed by the lights and motion. She gasped. "My goodness, how beautiful America is!"