Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The head of Homeland Security defended President Donald Trump's immigration order but said he erred in not telling lawmakers about it before it went into effect.

John Kelly made the admission Tuesday under questioning by the House Homeland Security Committee, describing a rush to implement the Jan. 27 executive order "so that potential people who might be coming here to harm us wouldn't be taking advantage of a period of time to get on a plane to get here."

The order, signed on a Friday, triggered confusion at airports, with refugees, green card holders, students and professors blocked from coming into the country from seven Muslim countries.

Related: U.S. Judge Temporarily Blocks Trump Immigration Order Nationwide

Kelly, a retired Marine Corps general, said that while he saw the order coming, he didn't do a good enough job of making sure others did.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"In retrospect, I should have — and this is all on me, by the way — I should have delayed it just a bit in order to talk to members of Congress, particularly leadership of committees like this to prepare them," Kelly said.

He later added: "Lesson learned on me. I should have slowed it down by a day, maybe two, and probably should not have put it out on a Friday as we did."

The order is on hold as the Justice Department defends it in federal court. It temporarily barred people carrying visas from Sudan, Libya, Somalia, Syria, Iran, Iraq and Yemen from entering the United States out of terrorism concerns. It also temporarily banned refugees from all but one of those countries; those from Syria were stopped indefinitely.

Kelly said that he believed the order was "lawful and constitutional" and that the administration would win the legal battle.

Related: Trump Immigration Executive Order Fight Goes to Appeals Court

Critics of the order have called it a Muslim ban. Kelly, echoing the president, said that was incorrect — the countries were chosen because they were either state sponsors of terrorism or were in such disarray that the administration was not confident that proper vetting of newcomers was sufficient.

"My feeling is the vetting on the other end in those seven countries are suspect, and it is Mr. Trump's view, and my view, that we need to do a pause," Kelly said.

Opponents of Trump's order say the system already is rigorous: It typically takes up to two years for an applicant to be fully screened by various federal agencies, according to the State Department, and there has been a minuscule number of refugees who have turned out to have some sort of connection to terrorism.

Rep. Bennie Thompson of Mississippi, the committee's top Democrat, challenged Kelly for evidence that potential terrorists from the seven countries had entered the United States before the order or since it was was put on hold.

"It's entirely possible," Kelly said.

"But you don't have proof," Thompson countered.

"Not until the boom," Kelly replied.

Kelly also said the administration was not contemplating adding countries to the list and was open to removing some in the future. That seemed to contradict other administration officials, including White House Chief of Staff Reince Priebus, who have suggested that countries could be added.