WASHINGTON — As President Donald Trump signed a sweeping executive order Friday, shutting the borders to refugees and others from seven largely Muslim countries, the secretary of homeland security was on a White House conference call getting his first full briefing on the global shift in policy.
Gen. John F. Kelly, secretary of homeland security, had dialed in from a Coast Guard plane as he headed back to Washington from Miami. Along with other top officials, he needed guidance from the White House, which had not asked his department for a legal review of the order.
Halfway into the briefing, someone on the call looked up at a television in his office. "The president is signing the executive order that we're discussing," the official said, stunned.
The global confusion that has since erupted is the story of a White House that rushed to enact, with little regard for basic governing, a core campaign promise that Trump made to his most fervent supporters. In his first week in office, Trump signed other executive actions with little or no legal review, but his order barring refugees has had the most explosive implications.
Passengers were barred from flights to the United States, customs and border control officials got instructions at 3 a.m. Saturday and some arrived at their posts later that morning still not knowing how to carry out the president's orders.
"The details of it were not thought through," said Stephen Heifetz, who served in the Justice and Homeland Security departments, as well as the CIA, under the previous three presidents. "It is not surprising there was mass confusion, and I expect the confusion and chaos will continue for some time."
Stephen Bannon, chief White House strategist, oversaw the writing of the order, which was done by a small White House team, including Stephen Miller, Trump's policy chief. But it was first imagined more than a year ago, when Trump, then a candidate for the Republican nomination, reacted to terrorist attacks in San Bernardino, California, by calling for a "total and complete shutdown of Muslims entering the United States."
In the months that followed, Trump's campaign tried to back away from the proposal, which was seen by Democrats as over-the-top campaign rhetoric that would never be reality. Trump offered few details as the campaign progressed, and as president-elect he promised to protect the country from terrorists with only vague promises of "extreme vetting."
But Bannon, who believes in highly restrictive immigration policies and saw barring refugees as vital to shoring up Trump's political base, was determined to make it happen. He and a small group made up of the president's closest advisers began working on the order during the transition so Trump could sign it soon after taking office.
A senior administration official said the order was drafted in cooperation with some immigration experts on Capitol Hill and members of the "beachhead teams" — small groups of political appointees sent by the new White House to be liaisons and begin work at the agencies.
James Jay Carafano, a vice president of the conservative Heritage Foundation and a member of Trump's transition team, said that little of that work was shared with career officials at the Homeland Security Department, the State Department or other agencies.
There was "a firewall between the old administration and the incoming one," Carafano said.
One reason, he said, is that when the Trump transition team asked pointed questions suggesting new policies to the career officials, those questions were swiftly leaked to the news media, generating negative stories. So the Trump team began to limit the information they discussed with officials from the previous administration.
"Why share it with them?" Carafano said.
R. Gil Kerlikowske, who served as commissioner of Customs and Border Protection under former President Barack Obama, said his staff had little communication with Trump's transition team, who made no mention of a bar on entry for people from certain countries.
White House officials in the meantime insisted to reporters at a briefing that Trump's advisers had been in contact with officials at the State and Homeland Security departments for "many weeks."
One official added, "Everyone who needed to know was informed."
But that apparently did not include members of the president's own Cabinet.
Jim Mattis, the new defense secretary, did not see a final version of the order until Friday morning, only hours before Trump arrived to sign it at the Pentagon.
Mattis, according to administration officials familiar with the deliberations, was not consulted by the White House during the preparation of the order and was not given an opportunity to provide input while the order was being drafted. Last summer Mattis sharply criticized Trump's proposed ban on Muslim immigration as a move that was "causing us great damage right now, and it's sending shock waves through the international system."
Customs and Border Protection officers were also caught unaware.
They contacted several airlines late Friday that were likely to be carrying passengers from the seven countries and "instructed the airlines to offload any passport holders from those countries," said a state government official who has been briefed on the agency's actions.
It was not until 3 a.m. Saturday that customs and border officials received limited written instructions about what to do at airports and border crossings. They also struggled with how to exercise the waiver authority that was included in the executive order, which allowed the Homeland Security secretary to let some individuals under the ban enter the country case by case.
One customs officer, who declined to be quoted by name, said he was given a limited briefing about what to do as he went to his post Saturday morning, but even managers seemed unclear. People at the agency were blindsided, he said, and are still trying to figure things out, even as people are being stopped from coming into the United States.
"If the secretary doesn't know anything, how could we possibly know anything at this level?" the officer said, referring to Kelly.
At the Citizenship and Immigration Service, staff members were told that the agency should stop work on any application filed by a person from any of the countries listed in the ban. Employees were told that applicants should be interviewed, but their cases for citizenship, green cards or other immigration documents should be put on pause, pending further guidance.
The timing of the executive order and the lack of advance warning had homeland security officials "flying by the seat of their pants," to try to put policies in place, one official said.
By Saturday, as the order stranded travelers around the world and its full effect became clear, Reince Priebus, the chief of staff, became increasingly upset about how the program had been rolled out and communicated to the public.
By Sunday morning, Priebus had to defend the immigration ban on NBC's "Meet the Press," where he insisted that the executive order was rolled out smoothly. He also backpedaled on the policy and said that the executive order's restrictions on entry to the United States would not apply to legal permanent residents "going forward."
As White House officials also insisted Sunday that the order had gone through the usual process of scrutiny and approval by the Office of Legal Counsel, the continuing confusion forced Kelly to clarify the waiver situation. He issued a statement making clear that lawful permanent residents — those who hold valid green cards — would be granted a waiver to enter the United States unless information suggested that they were a security threat.
But senior White House officials insisted Sunday night that the executive order would remain in force despite the change, and that they were proud of taking actions that they said would help protect Americans against threats from potential terrorists.
That assertion is likely to do little to calm the public furor, which showed no signs of waning at the beginning of Trump's second full week in the Oval Office.
Carafano said he believed that the substance of Trump's executive order was neither radical nor unreasonable. But he said Trump's team could have delayed signing the order until they had better prepared the bureaucracy to carry it out.
He also said the president and his team had not done a good job of communicating to the public the purpose of the executive order.
"If there is a criticism of the administration, and I think there is, I think they have done a rotten job of telling their story," he said. "It is not like they did not know they were going to do this. To not have a cadre of people out there defending the administration — I mean, really guys, they should have done this."
Reporting was contributed by Eric Lipton, Eric Schmitt and Charlie Savage from Washington, and by Joseph Goldstein from New York.