Some days, Rolando would bleed out of his eyes, ears and nose. Other days, he’d lie on the floor, dizzy or barely conscious.

But every time the jailed Guatemalan asylum seeker sought help from a doctor, staff at his US immigration detention center offered the same treatment: ibuprofen.

The 27-year-old migrant survived a gunshot wound to the head in Guatemala and was suffering from excruciating headaches and possible brain hemorrhaging when he presented himself at the San Ysidro port of entry earlier this year. US authorities responded by isolating him in solitary confinement and jailing him for months at the Otay Mesa detention center in San Diego, giving him sporadic access to medical staff and medicine, his records show.

“I feared I was going to die,” Rolando, who asked not to use his full name due to threats against his life, told the Guardian. “I thought in this country, there is really good medical care … but I wasn’t getting any treatment.”

Rolando made it out of Immigration and Customs Enforcement (Ice) detention alive, but his battle isn’t over. He’s still fighting to get asylum, based on the physical torture and persecution he fled as an indigenous Guatemalan. Every step of his journey has collided with the Trump administration’s aggressive attacks and expanding restrictions on migrants and refugees.

Now, the White House is moving to block Central Americans like Rolando from presenting their cases at the border, a move that experts agree will have devastating and fatal consequences.

“I came to the United States because I’d like to at least make it to 30,” Rolando said.

An orphan who escaped death: ‘I don’t have anyone left’

When he met the Guardian on a recent morning, Rolando carried the charger for his ankle monitor, which asylum seekers awaiting hearings are frequently forced to wear. He’s often worried about it running out of battery.

Seated inside the small legal services office of Al Otro Lado, above a pizza shop in San Diego, Rolando looked down and wove a bracelet with his hands as he talked, a practice he developed inside detention to pass the time and distract from his health problems. His native Mayan language is Qʼeqchiʼ, but he talks to his attorney in Spanish, which he was forced to speak in jail.

Rolando was born into chaos in 1992 in the Petén region of northern Guatemala. His father had been a member of the armed forces but resigned and became a supporter of the pro-indigenous movement. He was killed as a result, just after Rolando’s birth, and his mother died soon after “from the trauma”, he said.

He was an orphan at age one: “My brothers and sisters couldn’t take care of me … and they gave me to neighbors.”

Rolando became homeless and later a frequent target of violence by the people who he believes killed his father. Police tortured him when he sought help. According to his asylum application, that included placing nails in his hand and foot and burning his arms with hot knives.

In 2016, while at a soccer game, assailants shot Rolando in the head and left him with a written death threat that referenced his father’s murder. He survived, was forced into hiding and was unable to get medical attention. He said he had to remove the bullet himself. Police later refused to help and assaulted him, according to his file.

“I don’t have anyone left,” he said, adding that fleeing to the US was his only option: “Giving me an opportunity to be here is giving me an opportunity to stay alive.”

He escaped to Mexico and joined a caravan last year, eventually making it to Tijuana. Then the waiting began.

As part of a vast crackdown on migration, the border patrol under Trump has instituted a policy known as “metering”, which limits the number of people who can apply for asylum each day. In Tijuana, this has led to a waitlist that has more than 10,000 people, with a few dozen allowed to cross daily, creating a wait time of roughly six to nine months, lawyers estimate.

Trump’s “Remain in Mexico” policy has also resulted in nearly 50,000 migrants from Central America being returned to Mexico while their cases move forward. That has translated to overcrowded shelters, tent encampments and a struggle to access medical and legal services.

It also leaves migrants like Rolando vulnerable to the same violence they were escaping in their home countries. Rolando said he was beaten in Tijuana, suffering injuries to both his arms and forcing him to wear a cast.

In February, he was finally able to enter the US through the San Ysidro port of entry. In his initial processing, authorities took his injured arms – and placed him in handcuffs.

In detention, in agony and without treatment

Once he was in custody, Rolando’s health problems worsened. More than 150 pages of Ice’s medical records paint a picture of repeated health crises and his persistent struggle to get help.

Rolando regularly was bleeding from his eyes, ears and nose – the cause of which was unclear to doctors but might have been related to his gunshot wound. Rolando said he was bleeding soon after he was taken into custody and that as a result, he was placed in isolation: “They said, ‘We don’t know what’s wrong with you.’”

It’s unclear how many days he spent in solitary, but he said he had difficulty getting any treatment while isolated, and that he would spend all day in a small cell with no window to the outside. Staff would pass him meals through a small slat.

“I didn’t even know what was night and what was day,” he recalled. “I was sick already, but I was starting to get worse … Nobody was coming to see me.”

Once in the general population of Otay Mesa, Rolando continued to suffer periodic bleeding, and at times his head pain was so severe, he would lose consciousness, or he would lie on the ground so that he would not injure himself if he passed out.

Rolando made bracelets and sold them to other detainees so he could buy instant soup, he recalled. Photograph: John Francis Peters/The Guardian

Rolando would frequently sign up for “sick call” to visit medical staff, but he said the appointments did little to help. Records show that on one visit, a nurse told him to drink more water and “wash hair/head thoroughly”.

Eating the facility’s meats also started to make him sick, but he often struggled to get alternative food options, even though the medical staff said he needed to change his diet. Sometimes he made bracelets and sold them to other detainees so he could buy instant soup, he recalled.

The records show that the main form of treatment Rolando received was prescriptions for ibuprofen – in increasingly high doses as his pain worsened. Sometimes, he said, he ran out of ibuprofen and had difficulty getting a refill. He also received an ointment for his eyes.

Anne Rios, his attorney with Al Otro Lado, said she was stunned when she was finally able to get a copy of his medical records: “It seems unbelievable, almost too absurd to be true, but it’s not only documented, it’s the government’s own records.”

By August, Ice had twice refused to release him while his asylum case was pending even after dozens of medical visits, including multiple to the emergency room. One ER doctor had written that he was a “serious patient that presents with significant complexity of risk”, adding that he might have some kind of brain hemorrhage.

He had no criminal history or immigration violations.

Rolando grew increasingly desperate. At one point, he considered giving up and deporting himself back to Guatemala – a certain death, Rios said, recalling him telling her on one visit: “‘I’m gonna die here or in Guatemala, so I would at least rather go to my home country … I just can’t take it any more.’”

After a third request by Rolando’s attorneys, an Ice officer ruled that he could be released – but only if he paid a $5,000 bond.

“For many, $5,000 might as well be $5m,” said Rios. “They come here with nothing, no resources, no family members, absolutely no way to pay for that.”

Rolando was only able to get out when Al Otro Lado found a way to cover the amount through its bond fund.

Ice declined to comment on Rolando’s case, citing his privacy. A spokeswoman said: “everyone in our custody receives timely access to medical services and treatment”, including a full health assessment with two weeks of custody, daily sick calls and 24-hour emergency care. A dietician ensures detainees’ “unique health (included allergies), dietary, and religious needs are met” for each meal, and all food “must be visually appealing, palatable, and taste good”.

A final plea: ‘I followed the rules and I am telling the truth’

Rolando struggles to understand why the US has treated him like a criminal: “I followed all the rules and I asked for admission.”

Trump, however, is working to make the asylum process much more restrictive than what Rolando has experienced. His administration passed a policy in July banning migrants from seeking asylum at the US-Mexico border if they came from another country, saying they must first seek protections elsewhere.

The supreme court ruled last month that Trump’s ban could go into effect while legal challenges continued.

Trump visits a section of the US-Mexico border wall in Otay Mesa on 18 September. Photograph: Tom Brenner/Reuters

Rolando was released in September and is awaiting an asylum hearing scheduled for next week. He said he wanted to speak out because he was particularly upset about the treatment he saw other detainees face at Otay Mesa. Some were disabled and unable to walk to the cafeteria to get food, he said, noting that he got reprimanded when he tried to bring them food.

“They abuse their power with us,” he said.

Otay Mesa has repeatedly faced accusations of severe medical neglect. Last week, a detainee died in custody.

Rolando said he wanted the government to understand that people seek asylum because they have no other option – and that officials should believe him: “When you’re asking for asylum, you’re swearing to tell the whole truth and nothing but the truth. I am telling the truth.”