Joseph Mancuso of Phoenix, Ariz., woke up at 6 a.m. on Friday to an email from a U.S. State Department email address that said he should send information about himself, including his name, passport number, gender, email address, phone number and the earliest time he could arrive in Marrakesh on Friday if he wanted to take a chartered flight home.

Mr. Mancuso, who works in Dubai, had been in Morocco for two weeks and was among the thousands of Americans who have been stranded in Morocco since the kingdom announced that it was suspending all flights into and out of the country on Sunday.

Around 8:30 a.m. he received confirmation that he had a seat on a flight. Using a WhatsApp group with more than 100 other Americans also trying to leave Morocco, he made plans to share a taxi from Casablanca, where he was, to Marrakesh Menara Airport, where British Airways flights would be leaving. The drive took two-and-and-a-half hours.

“At the airport they did a quick fact check, I had to fill out some paperwork from the consulate or embassy and then walk to a B.A. check-in counter,” Mr. Mancuso said. “ From the time I got to the airport to now it’s been under an hour. It’s been so organized.”