Homeland Security Secretary John Kelly on Tuesday denied reports that he was kept in the dark about President Trump’s immigration executive order, while defending the plan's implementation and vowing to carry out the order "humanely."

“We knew it was coming. It wasn’t a surprise,” Kelly said, in his first press conference since the order on Friday suspended refugee admissions and temporarily restricted immigration from seven predominantly Muslim countries. “We knew Friday morning that it was going to be signed."

Kelly, along with the White House, was trying to settle a firestorm in Washington over the rollout of the executive order. The night before, Trump fired and replaced his acting attorney general after she refused to defend the measure -- amid reports that Kelly and other top Cabinet officials were not fully informed of the order's contents in advance.

Kelly, though, said Tuesday he knew the ban could be coming as far back as 18 months ago when Trump was making it a campaign promise.

Specifically, he said that DHS lawyers participated in preparing the executive order, that he learned Tuesday or Wednesday the order would be signed, and that on Thursday he “found out it would be signed the next day.”

Kelly also said he “had the opportunity to [review] at least two drafts,” dismissing reports that he learned about Trump signing the order while he was on an airplane.

Within minutes of Kelly concluding his remarks, White House Press Secretary Sean Spicer said the White House and DHS were working together from the start.

“There was proper coordination and preparation,” Spicer said during the daily White House briefing.

Trump's executive order includes a 120-day suspension of the U.S. refugee program and a 90-day ban on travel to the United States by citizens of Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen. On Saturday, the U.S. processed thousands of incoming foreign travelers in airports across the country.

Kelly also gave assurances Tuesday that he and his agents would execute the order “humanely and with professionalism.”

“We cannot gamble with American lives,” said Kelly, who also made clear that the temporary ban on immigration from the seven countries and on the U.S. accepting Syrian refugees is “not a ban on Muslims.”

“The vast majority of Muslims living on this planet have access to the United States. A small number is being help up temporarily,” said Kelly, suggesting a major problem is getting good information from the seven countries to verify “who these people say they are.”

Kelly was joined at the press conference by Kevin McAleenan, the acting Customs and Border Protection commissioner, who said the agency’s top officials, upon getting guidance from the White House, immediately began making calls, providing written guidance to field agents and contacting “stakeholders,” particularly the airlines.

He also said 872 refugees will be allowed into the U.S. despite the order, under individual waivers.

McAleenan pledged his agency’s commitment to carrying out the executive order and said he had no knowledge of insubordinate agents.

However, McAleenan acknowledged that “the communication hasn't been great in the initial hours of this rollout."