Greta Dargie, a research fellow at the University of Leeds in England, was deep in a forest in the Democratic Republic of the Congo when her university sent a speed boat to get her out. On March 25, the country had imposed a state of emergency and announced plans to close its borders because of the coronavirus pandemic.

She arrived in Kinshasa, the capital, a day after the last international flight left the country.

"My main problem is that I cannot get out of Kinshasa," Dargie said. "The city has been isolated in that no one can leave or enter by boat, road or air."

In some of the most far-flung corners of the world, scientists conducting research in the field have had to abandon their work and scramble to try to get home as the pandemic prompts countries to go into lockdown and most air travel grinds to a halt.

Many are still marooned after getting swept up in rapidly changing travel restrictions, countrywide quarantines and shelter-in-place orders. Others have made it home only after rescues that might have impressed Indiana Jones.

Dargie entered the Democratic Republic of the Congo on Jan. 14 to study what role tropical peatlands in the Congo Basin play in the planet's carbon cycle and how these ecosystems may respond to global warming and changes in land management. Now, she's waiting on news from the British Embassy about an evacuation flight.

Britain's Foreign Office announced Monday that hundreds of thousands of citizens — many of them tourists — have been repatriated from around the globe. Efforts are ongoing, and the Foreign Office said it is still negotiating with countries that have closed their airspace, as the Democratic Republic of the Congo did, to retrieve citizens stuck abroad.

According to the State Department, more than 22,000 Americans have been repatriated from 50 countries since Jan. 29. Yet there are still tens of thousands of citizens — scientists and tourists alike — waiting to return home.

For about a week, Julie Tierney was one such American.

Unable to fly out of Peru and growing frustrated with a lack of information from the U.S. Embassy, Tierney, 28,a Ph.D. student studying ecology and evolutionary biology at Princeton University, posted on Twitter in what she called a "desperate attempt" to get help.

"I am a #Princeton graduate student stuck in #Iquitos, #Peru during this global crisis," she tweeted on March 22. "The borders are closed indefinitely and I cannot get back to my family. If you are another researcher or student #StuckInPeru in #Loreto, reach out so we can coordinate efforts #Covid_19"

Full coverage of the coronavirus outbreak

The message was retweeted more than 250 times, and Tierney eventually heard from other stranded scientists — researchers who had been conducting experiments and gathering data in the field as a global health crisis escalated at a breakneck pace.

Tierney traveled to Peru in late February to study white-sand forests that are scattered throughout the Amazon. Giovanna Figueroa

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

On March 15, Peru's president, Martín Vizcarra, declared a state of emergency and announced plans to shut the country's borders for at least 15 days — a nationwide quarantine that the government said would go into effect the next day.

At the time, Tierney was preparing for a three-week stay at her field site to study unique rainforests known as white-sand forests that are scattered throughout the Amazon. But within days of the announcement, more countries were going into lockdown, and she realized that the window of opportunity to leave was closing fast.

"My thinking changed I think March 21st when Vizcarra announced that borders and airports would be 'permanently' closed," she said via WhatsApp. "Cases were also starting to grow exponentially in the U.S. It was then I decided that I needed to get back to my family ASAP."

But arranging for an evacuation from Iquitos — "a city in the middle of the Amazon that is only accessible by boat or plane," Tierney said — would prove challenging.

The State Department was quickly overwhelmed with repatriation efforts, and the U.S. Embassy in Peru was "extremely slow in responding to this situation," Tierney said, leaving her "disappointed and disillusioned."

Tierney's tweet caught the attention of Kara Fikrig, 27, a Ph.D. student at Cornell University, who was in Iquitos studying how mosquitoes that transmit dengue fever may be hitching a ride on boats to travel between towns along the Amazon.

Fikrig with her research team in Iquitos, Peru. Ethan Degner

Although they had never met, Tierney and Fikrig had been in Peru since late February, and both now found themselves stranded in a remote outpost famous for being the biggest city in the world that cannot be accessed by road.

"I have never felt quite that level of happiness to be connected with someone living a similar experience," Fikrig said. "The decisions that we had to make were the same — the same risk, the same sacrifice, the same desire to be with loved ones. It was great to connect with someone who could validate all those emotions."

Many scientists found themselves faced with unique professional challenges while navigating an unprecedented public health emergency in a foreign country.

"It was mass pandemonium at the airport," said Brian Enquist, a professor of ecology and evolutionary biology at the University of Arizona, who was leading a weekslong course in Peru to study the effects of climate change on plants and their ecosystems when the government canceled all international flights. "It was just pure chaos."

Enquist and 26 students in his charge were also stuck waiting for an evacuation flight. After about a week at a remote ecological research station near Manú National Park, the scientists hurriedly packed up and drove through the night to the city of Cusco in an attempt to board one of the last commercial flights out of the country.

Fifteen European students in the program had already left the country after the Peruvian government announced a travel ban to and from Europe. Shortly afterward, Peru's president expanded the restrictions to all international flights. Enquist and the remaining students — including many Americans — would spend the next two weeks holed up in a hotel in Cusco awaiting word from the embassy.

"It was essentially a military state," said Laura Jessup, a Ph.D. student at Purdue University, who participated in the program. "The day before the borders actually closed was pretty hectic. It wasn't dangerous, but people were lined up for blocks outside of grocery stores, ATMs were running dry and police officers were in the streets with assault rifles.

Download the NBC News app for full coverage of the coronavirus outbreak

To maintain some semblance of normalcy and to salvage what they could of the fieldwork conducted the week before, the scientists maintained a rigorous schedule and processed as much data as their spotty internet access allowed. And as coronavirus cases soared in other countries, the researchers closely monitored their own health.

"Every day we all took our temperatures and had them written down, because we're scientists, and that's just what we do with data," Jessup said. "The virus was certainly a concern, and as time went on, we were becoming more and more concerned with getting out of Peru before the hospitals got overwhelmed."

Researchers from around the world participated in a course co-led by Enquist at a remote research station near Peru's Manú National Park. Sehoya Cotner

Despite watching with apprehension as the military escalated its presence on Peru's streets and as rumors circulated that restrictions on movement in the country could become even more draconian, the scientists said they recognized the need for such extreme measures. When Peru enacted its lockdown, the country had around 100 confirmed coronavirus cases, which was still a relatively low number compared to other hard-hit regions of the world.

"Peru is doing everything they can to keep their citizens safe during this crisis," Tierney said. "This health care system is already overwhelmed by a dengue epidemic here. I had to go to the hospital a few weeks ago for a severe fever, and it was absolutely full."

After several failed attempts, Tierney and Fikrig were evacuated Thursday from Peru, flying first to Miami and then their respective homes in New Jersey and New York. Enquist, Jessup and most of the remaining students were also evacuated Thursday.

But wrapped up in the relief of making it home is the disappointment of having to abandon their research.

"Unfortunately because I was unsure about how I would get home, we had to leave behind most of our equipment and samples etc, so I could travel light," Dargie said via WhatsApp. "We are hoping we can come back but obviously no one is sure when this will all be over."

Tierney and Fikrig also had to make tough decisions to abandon their fieldwork — research that they had devoted time and effort to and had fought to get funded.

"I had worked so incredibly hard to make this research in Peru happen, and I was just at the precipice of beginning that work when the lockdown happened," Fikrig said. "This will likely delay my graduation."

Tierney's research was going to be the cornerstone of her dissertation, and her work in Peru had been planned years in advance.

"I hope that I will be able to come back later this year to start again, but everything is so uncertain now and nobody can make plans," she said. "I've accepted that I may have to spend an extra year in graduate school, but I care deeply about this project and I want to see it to fruition."