IQUITOS, PERU — Deep in the Amazon rainforest, at a jungle hospital teeming with patients, two U.S. medical students are racing to save a man's life.

Alex Gorin and Diana Partida are rushing the patient to the facility’s only CT scanner in hopes of identifying the source of a mysterious bacterial infection.

The hospital is sweltering. The lone computer on their floor is down. And basic equipment — disposable thermometers, blood pressure cuffs, ultrasound machines — are nowhere to be found here.

Fortunately, the CT scanner is working after being offline for two days. The images show large collections of fluid in the man’s body — a sign his condition is worsening.

If this were the United States, he would be sent to the intensive care unit immediately. But that’s not an option now.

Why? The six-bed ICU is already full.

“I was expecting to have the resource limitation,” Gorin, 29, said as he and Partida, 26, waited for a bed to open up. “It’s still extremely difficult to see it in reality and experience it emotionally.”

Alex Gorin and Diana Partida at work inside a remote hospital in Iquitos, Peru. Jake Whitman / NBC News

The chance to work under extreme conditions is precisely what brought Gorin and Partida to this remote corner of the world.

The pair are members of a select group of UCLA medical students who traveled thousands of miles to Iquitos, the largest city in the world that cannot be accessed by road.

Over three weeks, they trained under local doctors at a bare-bones hospital flooded with patients suffering from ailments familiar and unfamiliar — everything from appendicitis to zika, as well as cholera, malaria and dengue.

”I have no question that they’ll be better doctors. It changes who they are,” said Dr. Kelsey Martin, the dean of UCLA’s David Geffen School of Medicine. “This is a critical period where they can experience something that is going to blow their mind.”

Programs that expose medical students to challenging environments overseas aren’t new, but experts say they’re especially crucial now given the escalating crisis in American medicine.

Some 106 rural hospitals have closed since 2010, including 24 in the last 14 months alone, according to the National Rural Health Association. An additional 673 hospitals are in financial straits and at risk of shutting down, the group says.

The closures, caused by a confluence of factors including reduced access to Medicaid and hospital consolidations, have contributed to the country’s soaring infant and maternal mortality rates, experts say.

Craig Kennedy, the executive director of the Association of Clinicians for the Underserved, said large swaths of the United States are starving for the kind of doctors who emerge from overseas experiences having learned how to do more with less.

“Programs like these provide valuable training to those on the front lines in delivering health care to underserved, vulnerable communities across the country,” Kennedy said. “We need thousands of well-trained providers right now in high need areas of the country.”

Dr. John Cullen runs a 10-bed hospital in the tiny town of Valdez along Alaska’s wild southern coast. The closest major medical center is more than 300 miles away.

“It’s a very intensive kind of medical experience here and we do it with fairly limited resources,” Cullen, who is the president of the American Academy of Family Physicians, said. “In that respect, it’s probably similar to what the students experienced in Peru.”

“I hate to say it,” Cullen added, “but having that experience would lend itself very well in the U.S. It’s a sad commentary on where things are at right now, but there is so much need in rural America.”

The UCLA students arrived in Iquitos in late March. They were greeted by a chaotic and enchanting city of 1 million people, where pink dolphins glide through the waterways and three-wheeled motorized rickshaws rumble across dusty streets.

The streets flood during the rainy season, forcing the locals to build elevated walkways of wooden planks high into the air.

Elevated walkways built by locals during the rainy season when floodwaters make the streets impassable. Jake Whitman / NBC News

Iquitos sits on the banks of the Amazon River and sees a steady stream of adventurous tourists, for whom it acts as the gateway to the rainforest. For the locals, the hospital is among its main attractions.

The Regional Hospital of Loredo receives crowds of patients every day, some of whom arrive by boat after journeys spanning weeks.

The stately four-story red brick building looks impressive from the outside. But the inside is hot, decrepit and crowded. It’s not uncommon for doctors to show up for work in the early morning and already see dozens of patients lined up outside. Some people end up sleeping in the hallways, beside broken down machines, during the duration of their loved ones' stays at the hospital.

Patients crowd into the Regional Hospital of Loredo. Jake Whitman / NBC News

The UCLA students work under the tutelage of doctors like Ernesto Salazar, the only brain surgeon in the region. He’s been at the hospital for 40 years, earning an annual salary of $24,000. Salazar could make more money almost anywhere else, but he stays in Iquitos in part out of a sense of duty.

“The health system in Peru is in crisis,” said Salazar, who also hosts the students at the home he shares with his wife, Rosie.

The conditions at his remote hospital are especially stark. He has paid for most of his equipment from his own pocket. The patients here are in a similar predicament. Once a doctor determines a course of treatment, it’s up to the patient or their family members to go to the hospital’s pharmacy to purchase their medicine, as well as the syringes, rubber gloves and any other supplies the doctor may need.

“This is our reality,” Salazar said.

From the start, the UCLA students faced circumstances that would have been unfathomable at the hospitals near their campus.

One woman arrived with a severe bacterial infection and failing liver. She needed the kind of care only available in the ICU. But she was denied a bed. The reason: she was too sick.

At this hospital, the ICU only accepts patients who are believed to have a decent chance of survival.

“I don’t know if her course really would have been different if she had been in the ICU or not,” Partida said. “But it definitely would be what we would have done at home.”

The woman ultimately succumbed to her illness, her final hours marked by the kind of pain and discomfort that should have been treated with a powerful narcotic like morphine, had it been available.

All the hospital had in stock was tramadol, a weaker painkiller.

“You could hear her gasping for breaths, moaning,” Partida said, still visibly shaken by the experience. “Obviously more could be done to alleviate that.”

Salazar and his colleagues don’t have the luxury of relying on high-tech equipment to identify a patient’s ailments. Neither do they have an array of medicines to treat their patients. Salazar impresses upon the students the importance of performing careful and comprehensive physical exams and poring over a patient’s medical history — skills that the UCLA students said aren’t always emphasized back home.

This kind of no-frills medical care, in which observation and careful listening stand in place of technology, was on full display when the students accompanied veteran local nurse Clara Bustamante on home visits.

Whenever a new baby is born in the community, Bustamante or another nurse pays a visit to their home with few tools of modern medicine, relying mostly on their powers of observation, instinct and experience.

Nurse Clara Bustamante with a mother and her baby. The baby gained significant weight after Clara paid them a home visit. Jake Whitman / NBC News

“The follow-up care here is exponentially incredible,” Nahda Harati, 27, said. “And it's something to be valued and carried over into our practices in the future.”

UCLA student A.J. Green put the lessons from Bustamante and Salazar to use in the present.

She and a team of local staffers were performing morning rounds one day when Green noticed something amiss with a patient who had undergone surgery to remove her gallbladder. It’s a routine procedure back home, rarely resulting in major complications. But staring at the woman now, Green saw signs the woman was in distress.

Green quickly discovered that her heart rate was elevated. The team had by now moved on to other patients, but Green hung back.

“I knew myself that she was sick and something was going on,” Green, 32, would recall later.

Within moments, the woman lost consciousness. She was suffering from internal bleeding and going into septic shock. Green called for help and soon a team of staffers was in the room working to resuscitate the patient.

It took some time but the woman eventually came to. Green insisted she be placed in the ICU and this time, the critical care director consented. The patient went on to make a full recovery.

UCLA student A.J. Green with a patient who suffered internal bleeding after gallbladder surgery. Jake Whitman / NBC News

When Green went to visit her a few days later, the woman’s face lit up at the sight of the young American who saved her life. “This is what the whole thing is about,” Green said. “What medicine is about.”

But for every triumph, there was tragedy. Molly Sprague, 28, spent days working to save the life of a mother of three suffering from a severe fungal infection. Wendy had traveled four days by boat to reach the hospital. But by the time she made it, her condition was already dire.

Wendy wouldn’t make it into the ICU, but that didn’t stop her mother from racing back and forth between the hospital pharmacy and her room ferrying medicines for her ailing daughter and supplies for the doctors.

After a few days, Wendy passed away, with Sprague and her anguished mother at her side. “Hearing her mom say to her, ‘Don’t leave. Don’t leave your kids. Don’t leave us.’ It was heartbreaking,” Sprague recalled.

UCLA student Molly Sprague cares for Wendy, who arrived at the hospital with a severe fungal infection and died a few days later. Jake Whitman / NBC News

The students spent many of their nights reflecting on their experiences at the hospital. Near the end of their time in Iquitos, they were joined by Dr. Lee Miller, the associate dean for student affairs at UCLA’s medical school.

Back in the mid-1990s, Miller traveled to Rwanda where he said he worked as the lone pediatrician at sprawling refugee camps amid one of the largest genocides in human history.

“There were 2,000 deaths a day,” Miller recalled. “I walked through fields with limited amount of clean water, having to decide which children to give the clean water to, rolling over children to see if they were alive. It was a living nightmare.”

The experience inspired him to create “Partners for Pediatric Progress,” the program at UCLA that sends students to countries where modern medicine is scarce.

“I believe that many of these difficult chapters will take a long time to process and that the lessons will be lifelong ones,” Lee told the students during one of their final days in Peru. “They certainly have been for me.”

Dr. Tochi Iroku-Malize, a global health expert not affiliated with the UCLA program, said it’s the students who gain these kinds of experiences who are most likely to go on to practice medicine in the neediest parts of the U.S.

“It’s only when you’ve learned to provide care in a place that has limited resources and you can see the results of providing that care, that you’ll know whether or not this is for you,” said Iroku-Malize, the chair of family medicine for the Donald and Barbara Zucker School of Medicine at Hofstra/Northwell in Long Island, New York.

“I’m hoping that this is a big deal for family medicine,” Iroku-Malize added, “in terms of trying to find a way to build the next generation of family physicians who are going to serve these underserved communities.”

The Regional Hospital of Loredo looks impressive on the outside, but the inside is hot, decrepit and crowded. Jake Whitman / NBC News

Some of the UCLA students are already planning to do exactly that. Partida, the daughter of Mexican immigrants, said she grew up around family members who struggled to get proper medical care.

“So it's really special to me to be able to work with patients in an underserved area because it just hits close to home,” Partida, who is the first in her family to graduate from college, said.

Raised in Los Angeles, A.J. Green left her inner-city teaching job at the urging of her students who encouraged her to pursue her dream of practicing medicine in disadvantaged communities.

Like the others who joined her in Peru, she graduated from the UCLA medical school in May. “I learned so many lessons,” Green said of her experience in Iquitos. Chief among them, she said, is “how doctors have become creative and what they’ve been able to do with a lack of resources.”

She’s hoping to work as a trauma surgeon at a facility that serves impoverished communities. Green’s first stop: a residency program at a county hospital in Los Angeles, in one of the poorest ZIP codes in the state.