Manuel Bernal could have sought a different assignment once the coronavirus pandemic hit Advocate Christ Medical Center, one of the busiest trauma hospitals serving Chicago’s South Side. His supervisor said she would not ask him to put his life on the line as an emergency medicine physician still in training.

Bernal already felt his future was in jeopardy as one of more than 640,000 undocumented immigrants known as “dreamers,” who could lose their work permits if the Supreme Court allows the Trump administration to end an Obama-era program that protects them from deportation.

But the 29-year-old resident pushed aside worries about his own vulnerability and the looming ruling and dove into emergency room work. One day recently, he tested seven people, all positive for the novel coronavirus. On the next, he intubated two patients with covid-19, the disease caused by the virus, as their oxygen levels plunged — an especially dangerous procedure for doctors because of the potential exposure to the aerosolized virus.

Bernal is among an estimated 29,000 health-care workers enrolled in the Deferred Action for Childhood Arrivals program who are working on the front lines of the battle against the coronavirus, even as their own futures in this country hang by a thread.

They include a registered nurse who drove her RV 700 miles from Utah to work in a Sacramento-area hospital, a Houston paramedic who slept for 20 minutes on a recent 24-hour shift, and a nurse’s assistant on Staten Island, who carefully wraps up bodies others are afraid to touch.

“We’re basically risking our lives,” Bernal said. “But I also understand it’s part of the job I signed up for. I think it’s worth it when I see some patients come in who are extremely ill and I’m able to intervene.”

President Trump, who has sought to end the DACA program since 2017, had hoped to phase out all DACA work permits by this year, but lower courts blocked him. The Supreme Court heard arguments in November, and lawyers said the justices could rule any week.

Anticipating a decision, lawyers for immigrants in the case submitted an eleventh-hour filing in March urging the court to consider the DACA recipients battling the pandemic.

“We think it would be catastrophic at this time” to terminate DACA, said Karen Tumlin, a lawyer for plaintiffs suing over the Trump administration’s decision to end the program. “We don’t have enough health professionals right now.”

Nearly 200 of them are medical students, residents or physicians, the Association of American Medical Colleges and other health-care training programs told the Supreme Court in a brief that warned the United States faced a shortage of doctors.

The Justice Department declined to comment on the litigation, but critics say they doubt the appeal would sway the court.

“I love my dental assistant, but that has nothing to do with the virus,” said Mark Krikorian, executive director for the Center for Immigration Studies, which favors limiting immigration. “This is just another example of advocates taking advantage of a crisis to pursue their political objectives.”

Trump has expressed willingness to strike a deal with Democrats to allow the immigrants to stay in the country in exchange for increased immigration enforcement. Otherwise, a top immigration official said in January, the dreamers could be deported.

But dreamers say the president’s plan would only divide their families by increasing the deportation risk for the other 11 million undocumented immigrants in the United States, including many of their parents.

Bernal’s college-educated parents brought him to the United States when he was 2, on visas they later overstayed, after the North American Free Trade Agreement flooded Cuernavaca, Mexico, with cheap electronics and put their typewriter repair shop out of business.

They bought a house in Tennessee and raised three children, insisting that they play sports and bring home good grades from school. The younger two were born here and are U.S. citizens.

Bernal had stellar grades in high school, joined the swim team and won a private scholarship to attend the University of Tennessee at Chattanooga. But medical school was costly, and as an undocumented immigrant, he was ineligible for federal financial aid.

Then, in 2012, the year before he graduated from college, President Barack Obama unveiled DACA. For the first time in his life, Bernal could apply for a driver’s license, take out a student loan and qualify for a U.S. medical school. He could work legally as a physician. He could stop hiding his immigration status from friends and put aside his fear of being deported.

But DACA always was a temporary fix that would not lead to U.S. citizenship.

During Bernal’s final year at the Loyola University Chicago Stritch School of Medicine, the Trump administration attempted to terminate the program. At the time, Bernal had $250,000 in student loans and had to compete for a residency spot in a hospital. School officials warned he might not even get a job interview amid uncertainty about the program’s future and whether he would be allowed to work legally.

Still, he got 20 interviews and landed at Advocate Christ Medical Center in Oak Lawn, Ill. In his two years there, he has treated people with heart attacks, gunshot wounds and injuries from car accidents — losing count of how many lives he has helped save. He said he feels at home in the “grit and grind” of the emergency room and likes that anyone can show up there and not be turned away.

The DACA program “let me become a doctor,” he said. “And it’s letting me treat and care for patients that are facing this deathly pandemic right now. Without DACA, none of it would have been possible.”

But there are moments of dissonance. As the death toll from covid-19 climbed, he heard the governor of Illinois urge retired doctors and nurses to come forward to serve as reinforcements. But many would be at higher risk of complications if they become infected because of their ages. DACA recipients, in contrast, tend to be younger, in their 20s.

“If you take away DACA . . . it is at least one doctor less to take care of a patient who is critically ill with this virus,” he said, referring to himself. “It makes a difference.”

Others in his situation describe similar dedication.

Houston paramedic Jesus Contreras, who earned fame for rescuing residents from floods after Hurricane Harvey in 2017, said he has been working nonstop during the pandemic.

“It’s just surreal,” said Contreras, 26, who arrived from Mexico when he was 6. “We’re just so bogged down and busy with work. . . . I haven’t had time to think about [DACA]. I’ve had some pretty rough shifts.”

Jose Angel Mejia Martinez, 25, a patient care assistant in the emergency room at Staten Island University Hospital in New York City, said in text messages and online posts that he is overwhelmed with patients. He is constantly exposed to the coronavirus by performing heart compressions or tending to the dead.

“Honestly what it really comes down to I am just grateful to have a job and be on the front lines helping people because that’s a passion of mine,” he said in a Facebook message between shifts, adding that he was brought to the United States from Mexico at age 2 and secured a work permit through DACA in 2013. “Some people right now are without work. I pray that I don’t get sick with the virus like some people are dying right in front of my eyes.”

Ana Cueva, a 27-year-old intensive care nurse, grew up in Utah after her parents brought her there from Mexico when she was 5. Nurses had helped save the life of her mother, who had cancer when Cueva was little, and she wanted to repay the favor.

“I love what I do, and I’m good at it,” she said as she prepared for another 12-hour overnight shift at a hospital in Vacaville, Calif., while she is on temporary assignment 700 miles from her home. But she said her immigration status is “in the back of my mind every single day.”

Mark Kuczewski, a professor of medical ethics at the Stritch School of Medicine, said DACA recipients are “ideal for disaster situations” because they have persisted despite the stress over their status in this country.

“Medical school is tough,” he said. “Residency is tough. You have to be tough on a daily level. You have to be able to face something like this every day.”

Even Bernal, who says he feels less at risk from the coronavirus because of his youth, said the pandemic has put him on edge. He worries about the older doctors and nurses whom he calls “heroes.”

His family worries about him. His sister sent him plastic goggles that she ordered online. His father, a co-owner of a restaurant, rummaged through storage and mailed him masks from past construction jobs. His mother texted prayers.

Elise Lovell, 54, director of the hospital’s emergency medicine residency program, said she was grateful Bernal and other residents were willing to serve in the emergency room.

“He is definitely risking his health, risking his well-being, every day that he goes into work,” she said, noting Bernal had the added strain of the court decision. “I just can’t imagine the stress that he must be under.”

“It’s crazy,” Bernal acknowledged Wednesday, getting ready for another shift and thinking about DACA. “It’s like two major bad things going on at once.”

But he said he had no intention of leaving his job in the emergency department — not unless the Supreme Court forces him out.