Department of Homeland Security Secretary John Kelly admitted he should have delayed the Muslim ban, taking the blame for an executive order that he reportedly was not even fully involved with.

"In retrospect, I should have, this is all on me by the way, I should have delayed it just it a bit, so that I could talk to member of congress, particularly the leadership of committees like this, to prepare them for what was coming," he testified before the Homeland Security Committee, "although I think most people would agree that this has been a topic of President Trump during the campaign and transition process."

He was responding to a question about what lessons he had learned after President Trump signed an executive order 12 days ago to bar nearly all travellers from seven Muslim-majority countries and which was then blocked a week later by a federal court in Washington.

Over the weekend Mr Trump was dealt a major blow when his emergency appeal to overturn the court’s ruling was denied. He has now threatened the case will go to the Supreme Court.

The order was reportedly crafted by Mr Trump’s chief strategist, Steve Bannon, including banning green card holders.

Mr Kelly testified that the order had been designed before he took on the role at the DHS, and he and his "very small staff" made some "small cuts" before it was signed into law.

It was reported that he and his staff were only allowed to see the order after Mr Trump signed it, and lawyers from the National Security Council were stopped from evaluating it.

"The desire was to get it out, the thinking was to get it out quick, so that potentially people that be coming here to harm us would not take advantage of a period of time to jump on a plane and get here," he said.

Less than a week before at a press conference, he had defended the roll-out of the ban and that he and his agency had been fully involved in its drafting.

He insisted that all detainees were treated humanely and reports of them standing around for hours “did not happen”. Regarding travellers being insulted, he said "insults are in the eyes of the beholder".

White House Press Secretary Sean Spicer said the number of detainees was only 109, but this number was disputed by Mr Kelly after he was pressed by reporters on higher figures.

Loading....

He promised that for any future similar executive orders, he would take the time to "inform Congress".

The Muslim ban led to Mr Trump firing former acting attorney general Sally Yates, who refused to defend the ban in court. The order led to a flurry of lawsuits which allowed legal, permanent residents to stay in the US even if they landed at an airport after the order was signed. Several lawsuits granted reprieve for individuals or families to stay in the country.

The largest setback was the lawsuit brought by Washington attorney general Bob Ferguson, who argued the ban was unconstitutional and should be halted.

"No one is above the President," said Mr Ferguson. "Even the President."

Judge James Robart ruled in favour of the case, prompting Mr Trump to threaten the "so-called judge" with an emergency appeal by the Justice Department.