Media playback is unsupported on your device Media caption Muslim students on Trump ban: 'I don't belong here'

US security chiefs have admitted flaws in the way President Donald Trump's bar on people from seven countries entering the US was implemented.

The policy has caused uproar internationally and was challenged by the acting US attorney general, whom Mr Trump then fired.

Top Republican Paul Ryan said he regretted that some people with valid documents had been affected.

But he also defended the ban, saying it aimed to prevent terror attacks.

In international reaction:

Saudi Arabian Oil Minister Khalid al-Falih told the BBC criticism of the ban was "exaggerated"

UK Home Secretary Amber Rudd warned that the travel ban could become a "propaganda opportunity" for so-called Islamic State. She called the US president's move "divisive" and "wrong"

New UN Secretary General Antonio Guterres said closing borders to people based on their religion, ethnicity or nationality was a "blind" measure which risked handing a propaganda victory to extremists

'Not the best'

Speaking at a news conference, the heads of the department of Homeland Security and Customs and Border Protection (CBP) said 720 people had been detained and "humanely processed" since Mr Trump's executive order was issued.

CBP chief Kevin McAleenan acknowledged that public and government communications had not been "the best" as the policy was rolled out.

Media playback is unsupported on your device Media caption John Kelly - this is not a ban on Muslims

He also said that although the order had suspended the US refugee programme, 872 refugees had been granted waivers and were due to arrive in the US this week because they had been ready to travel and preventing them from doing so would have caused undue hardship.

Homeland Security chief John Kelly denied that President Trump's order - which affects people from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen - amounted to a ban on Muslims and said the vast majority of the world's Muslims still had access to the US.

The 90-day order, he argued, would give officials time to analyse the strengths and weaknesses of the US immigration system, something which was "long overdue".

"Some of those countries may not be taken off the list any time soon," he said. "They are countries that are in various states of collapse."

Image copyright AFP/Getty Image caption Mr Trump's policy had led to big protests

The US was also considering examining the web browsing history, mobile phone contacts and social media profiles of visa applicants from countries where there was little confidence in local law enforcement agencies, he said.

Mr McAleenan offered some clarification on how dual citizens were affected, saying the US authorities would handle people based on the passport they were travelling on.

Several governments - including the UK, Canada and Switzerland - have already said that their citizens who are also citizens of the seven countries affected by the ban are free to travel to the US.

Mr Ryan said he was confident that the policy would now be "done correctly" and would impose the "kind of vetting standards that we all want to see".

"No-one wanted to see people with Green Cards or special immigrant visas, like translators, get caught up in all of this," he said.

Image caption Saudi Oil Minister Khalid al-Falih said criticism of the ban was "over exaggerated"

Many US officials remain critical of the policy, however.

Hundreds of American diplomats sent a memo to the state department's leadership on Tuesday expressing dissent.

"A policy which closes our doors to over 200 million legitimate travelers in the hopes of preventing a small number of travelers who intend to harm Americans from using the visa system to enter the United States will not achieve its aim of making our country safer," they wrote.

"This ban stands in opposition to the core American and constitutional values that we, as federal employees, took an oath to uphold."

White House spokesman Sean Spicer said earlier officials could "get with the programme or go".

The Saudi oil minister said travel restrictions after the 9/11 attacks in 2001 had affected thousands of Saudi Arabians but were later resolved and he expected the same to happen with Mr Trump's policy.

He said he did not think Mr Trump would place restrictions on Saudis entering the US because tens of thousands of Saudi students were studying there.

The fact that most of the 9/11 attackers were Saudis, he said, had been a deliberate attempt by former al-Qaeda leader Osama bin Laden to destroy the US-Saudi relationship.

But the two governments had seen through the ploy, he added.