One day they were surfing between classes, one of the perks of studying abroad on the coast of Peru. Then the country’s president declared a state of emergency, shutting the borders and imposing a quarantine.

“The teachers told us we had to make it to the next town by curfew,” said Zoe Lynch, 17, one of the students from the Traveling School, a study abroad program for young women. “We saw this huge military barricade thing. They did not want to let us in. That was real.”

The teachers pleaded that they needed to get to Huanchaco, a nearby coastal town, to shelter in place. Finally, the soldiers let them pass — on foot. Cars were restricted. They walked about 40 minutes to get to their hostel.

“Things were changing really fast,” said Isabel Estes, also 17. They woke to streets empty but for soldiers and police patrolling to enforce the emergency orders. They could see the beach but were not allowed to go there. Everything was quiet. The borders were sealed. They were trapped.

That was over a week ago. On March 16.

“There’s a lot of uncertainty here,” Lynch said. They want to return home. But they can’t. “We don’t know when we’re going.”

Last week, with the spread of the coronavirus pandemic wreaking havoc around the globe, the State Department warned Americans not to travel abroad and advised those overseas to return immediately — or expect to be forced to stay where they were indefinitely. Closed borders and canceled flights upended travel plans and stranded travelers — including American students, from teenagers to post-grads, studying abroad around the world.

Many have managed to get home. A group of university students, also stranded in Peru, finally got on a chartered flight from inland Cusco to Lima on Wednesday afternoon and landed in the United States that night. But that took the efforts of four university presidents working with government officials. The 19 students and teachers in Huanchaco, far from Lima’s international airport, are still stranded.

“Everything is happening so fast,” said Chandra Rosenthal, whose 15-year-old daughter, Kiki, is among the stranded teens. “It all started cascading. I expect that to continue, and I’m worried for the girls’ safety.”

Zara Ali, a student at Kenyon College in Ohio, wasn’t worried about the coronavirus when she left for a study abroad program in Buenos Aires on March 1. Back then, the outbreak seemed isolated to a few places in Asia and Europe.

When it became clear the disease was spreading, her host family tried to talk her out of leaving. Conditions were worse in New York, they said, and the travel home to Brooklyn could expose her to more risk. But flying was only becoming more fraught, so she booked a flight home after less than three weeks. “The worry we all had was just getting stuck in Argentina,” she said.

Anna Barr, a student from Michigan on the same program, initially chose to stay, even after university officials advised students to come home. When the private program was canceled outright, she booked a flight home for later that week, only to hear from U.S. officials that she should go to the airport immediately and try to fly home.

Her host mom made her mate, an herbal tea, to calm her down, and advised her in Spanish how to fold her clothes as she rushed to pack. She got on the flight, but it was diverted to Sao Paulo, Brazil, for an emergency medical situation, and then to San Juan, Puerto Rico, for a crew change, before finally landing in Atlanta. “I’m good. Tired, but good,” she said, before boarding the first of her two final flights home. “I’m glad to be back in the U.S.”

There were no confirmed cases of the coronavirus in Peru when six students from Augusta University in Georgia arrived in February. In the second year of their program to become physician assistants, the women had gone to Cusco to provide screenings and other women’s health services in a place with high rates of cervical cancer. They were living in a dorm with bunk beds over a health clinic and working in the obstetrics ward at the hospital.

Then they began to hear rumors about flight cancellations. They booked the earliest return flights they could find.

Within an hour, the president of Peru had announced the borders would be closed within 24 hours.

When their calls to the U.S. Embassy went unanswered, the students stuffed their clothes into bags, climbed into taxis and rushed to the consular agency.

The gates were closed. A notice was posted, but the phone number on it didn’t work. The police arrived and told them to disperse, along with the other frantic Americans who had arrived seeking emergency travel advice.

The six students climbed back in the cabs. But now the taxi driver said he couldn’t take them to the airport, because only people with confirmed tickets were being allowed near the terminal.

Back in their dorm, they tried to think of options. They couldn’t fly out, and they were too far from the border to drive out.

A week and a half later, Erin Hill, one of the students, said they were hearing there were some flights to and from Lima. But they were still unable to get there from Cusco.

The students had run out of the local currency they needed to buy food. They were running low on the medicine some of them needed. At last check, the only grocery store they were allowed to go to had run out of fresh produce.

“We’re worried about the food supply,” Nurin Ghazzawi said this week. They were also worried about a classmate who is immunocompromised. “It’s very necessary to get out sooner than later.”

Christen Engel, a spokesman for Augusta University, said the presidents of the University of Georgia, the University of South Alabama, Augusta University and Lenoir-Rhyne University in North Carolina sent a joint letter to multiple congressional delegations asking for help with 17 students, one faculty and one staff member who were unable to leave Cusco and Lima.

“There is a chartered plane on hold while we await clearance from the Peruvian government, which appears to be moving forward and bringing our students home soon,” Engel wrote in an email Tuesday.

“We’re just waiting,” Ghazzawi said earlier this week, “trying to be as hopeful as possible. We feel pressed for time. … Our biggest concern is things have changed so rapidly here, we don’t know what the future holds as well.”

On Wednesday afternoon, she sent a message: They had just touched down in Lima. “Hoping to be back stateside by tonight.”

Not long ago, Chandra Rosenthal said, Peru seemed liked a safer place for Kiki to be than their home in Denver. Colorado was shutting down, one of her sons was home all day from school, and the other was home from college. Meanwhile, there were only a few confirmed cases in Peru.

But just two days after the Traveling School group crossed the border from Ecuador into Peru, the Peruvian president announced the country was closing airports, shutting down land and air travel, and imposing a mandatory quarantine the next day, said Danika Robison, one of the teachers.

Jennifer Royall, the school’s executive director, said school leaders had been closely monitoring the outbreak, but with only four confirmed cases when the group traveled to Peru, the emergency declaration came as a surprise. “The U.S. Embassy has advised our school to shelter in place and await confirmed transport,” she wrote in an email this week. U.S. officials told them hundreds of Americans had been flown out since the quarantine began.

School officials are working with U.S. and Peruvian officials to try to get the group back to the United States, Robison said, but they don’t yet know when or how. “Without a flight,” she said, “we stay put.”

Annie Power of Takoma Park, Md., was thankful for kindness from people in Huanchaco. She’s waiting for her daughter Ruby Shumaker, a junior at Montgomery Blair High School who has been spending this semester with the Traveling School, to come home. A family brought ice cream and cake to the group one day to the group, which is unable to leave the hostel, Power said. “That’s what this is about for me — people helping each other.”

Robison said members of the military are trying to do their jobs, enforcing the ban on large gatherings, but that is creating difficulties for them because of the size of their group.

“It’s definitely a little anxiety-provoking to not know when we’re leaving,” Estes said. They’re trying to stay positive even as they abide by the strict rules of the curfew. They’re continuing classes, even mixing in some science curriculum on viruses. They tried to have a dance in the basement but soldiers told them to turn down the music. Even at breakfast, when a group of them was talking too loudly, Lynch said, they heard a whistle.

“I am packed, I am ready,” Lynch said. “I am ready the moment they say, ‘Let’s go.’”