It took nearly two hours from when President Trump signed his first attempt at a travel ban for the head of United States Customs and Border Protection to get an official version of the president’s executive order.

In the hours that followed, officials scrambled to figure out how to enforce the order and — as protesters, lawyers and politicians swarmed airports — they monitored the demonstrations with detailed granularity, setting up a “Crisis Action Team” to coordinate their response.

As officials begin to roll out President Trump’s latest attempt to severely restrict visitors from certain countries, internal documents provided to The New York Times offer a look at how the government tried to carry out his initial attempt at a travel ban.

The documents, which are dated from Jan. 27 (the day the first executive order was signed) to Feb. 4 (the day after a federal judge temporarily blocked the order from being enforced nationwide), depict an all-night sprint to implement the rules on the fly — a process filled with stops and starts, confusion and lots of conference calls.

Vera Eidelman, a fellow with the American Civil Liberties Union, which obtained the heavily redacted documents through public records requests, said in an email the group believes that the internal emails, memorandums and spreadsheets “are just the tip of the document iceberg, and do not reveal the full story.”

She wrote they show that “it wasn’t just the public that was confused about the Muslim Ban — top officials were, too.”

She added that nearly 2,000 travelers were subjected to extended questioning in the first week after the order.

Michael Friel, a spokesman for Customs and Border Protection, said he was not authorized to speak about specific internal correspondence. Speaking generally about policies and procedures, he said, “We have real-time information and intelligence that arise, and this organization is very experienced with adapting on a dime.”

When an order comes down, he said, “there is an implementation that occurs, and with any implementation you’re going to need to coordinate it and communicate about it.”

It was late on a Friday afternoon when President Trump signed the order blocking entry of refugees and citizens of seven predominantly Muslim countries for varying lengths of time.

Image

Volunteer lawyers at a terminal at Kennedy International Airport helped travelers caught up in President Trump’s executive order barring visitors from seven countries in January.CreditVictor J. Blue for The New York Times

The action led to chaotic scenes at American airports as human rights advocates, lawyers and the travelers themselves — some aboard flights in midair — tried to figure out what to do.

The documents reviewed by The Times help illustrate some aspects of the confusion at the agency.

At 5:24 p.m., about 40 minutes after Mr. Trump signed the order, Kevin McAleenan, the acting commissioner of Customs and Border Protection, asked in an email whether the agency had official confirmation it had been signed.

“Any way I can get the latest version electronically?” he asked in an email to several officials.

A minute later, an official replied, “they really need the signed version to assist in execution.” At 6:32 p.m., Mr. McAleenan received the final version.

The documents also include lengthy updates on the airports where protests occurred and details on the number of protesters, news reporters and politicians present, as well as the response by the police.

Emails detail the back and forth between officials as they tried to figure out whether the order was applicable to green card holders. Soon after Mr. McAleenan got the signed order, he asked about that issue.

Gene Hamilton, a senior counselor at the Department of Homeland Security, wrote that green card holders should generally be given a case-by-case exemption, “provided that it is in the national interest to do so (i.e. provided that there is no security risk posed, meaning that there should be a revetting of sorts).”

That response appeared to surprise Mr. McAleenan, who noted that under such an interpretation, the number of travelers affected would significantly increase. “We have 300 in the air inbound right now,” he said in an email, adding, “wanted to flag this as our understanding has changed.”

The documents show agency officials over the next several days held conference calls and drafted memos to guide employees on how to carry out the order and how to report their progress. Some memos explained who had the authority to grant waivers for green card holders, and documents also show officials sent requests for those waivers.

On Feb. 1, Don McGahn, counsel to President Trump, sent a memo clarifying the order did not apply to green card holders after all.

Two days later, a federal judge in Seattle temporarily blocked Mr. Trump’s order from being enforced nationwide.

At 8:23 p.m. that day, there was a memo from Mr. McAleenan that read in part, “suspend any and all actions.”

Steve Eder contributed reporting.

A version of this article appears in print on , on Page A16 of the New York edition with the headline: Memos Show Uncertainty On Travel Ban. Order Reprints | Today’s Paper | Subscribe