Homeland Security Secretary John Kelly took the blame for the rocky rollout of President Trump's travel ban on people from seven mostly Muslim countries.

Kelly defended the ban in an appearance before the House Homeland Security Committee, which he labeled a "pause," as lawful and constitutional. But he said he should have given lawmakers a heads up before the president signed the order.

"This is all on me," Kelly contended. "I should have delayed it just a bit, so I could talk to members of Congress particularly the leadership of committees like this to prepare them for what was coming."

Kelly rebutted criticism from lawmakers upset with how some travelers were reportedly treated at airports the weekend the order was put in place. He said no one was forced to stand for hours at a time and that the Customs and Border Patrol Agents under his command behaved professionally.

He said the temporary immigration ban was needed because vetting in the affected nations was "loose" and that many of the countries on the list were failed states. Asked why Saudi Arabia, where most of the 9/11 hijackers came from, was not on the list, he said they have "very very good police forces and intelligence forces, so we know when someone comes here from Saudi Arabia who they are and what they've been up to."

Democrats pushed back. Bennie Thompson, of Mississippi, the senior Democrat on the panel, argued that the ban could put Americans at risk. Pointing to a picture of a young Somali girl holding a teddy bear, Thompson said she had been vetted "for years."

Suspending the admission of people like her "does nothing to make us safer," Thompson said. "To the contrary," the executive order "makes America less safe by serving as a recruitment and propaganda tool for terrorist groups."

Kelly said thousands of people who fought alongside ISIS in Syria could have the kind of papers that would allow them to get into Europe and then to the U.S.

Kelly seemed to suggest judges might be too isolated to rule properly on the issue. He said he "had nothing but respect for judges," but "in their world it's a very academic, very almost in a vacuum discussion."

And Kelly added, "Of course, in their court rooms, they're protected by people like me."

Copyright 2017 NPR. To see more, visit http://www.npr.org/.