US President Donald Trump signed an order -- which temporarily freezes new visas for Syrians, Iranians, Libyans, Somalis, Yemenis and Sudanese citizens -- behind closed doors (AFP Photo/SAUL LOEB)

US President Donald Trump signed a revised ban on refugees and on travelers from six Muslim-majority nations Monday, scaling back the order to exempt Iraqis and permanent US residents.

With his first attempt frozen by federal courts, Trump signed a second order freezing refugee admissions for 120 days and halting new visas for Syrians, Iranians, Libyans, Somalis, Yemenis and Sudanese citizens.

The White House said Trump -- who is embroiled in controversy over his aides' links to Russia and his own Twitter outbursts -- signed the order behind closed doors Monday morning.

The new order comes into effect on March 16 and is meant to address legal problems. It explicitly exempts Iraqis, legal permanent residents and valid visa holders.

"The principles of the executive order remain the same," said White House spokesman Sean Spicer.

Secretary of State Rex Tillerson, one of three cabinet members rolled out to present the order in Trump's absence, described it as "a vital measure" for strengthening national security.

Attorney General Jeff Sessions added that it "provides a needed pause" allowing a review of how America deals with travelers from "countries of concern."

"Three of these nations are state sponsors of terrorism," Sessions said, referring to Iran, Sudan and Syria.

He added that others had served as "safe havens" for terror operatives.

Critics questioned the composition of the list, which includes citizens from countries that have never been involved in terror attacks in the United States.

Non-governmental groups accused Trump of covertly pursuing his controversial and possibly illegal campaign promise of a "total and complete shutdown of Muslims entering the United States."

The question of Trump's intent is likely to dominate new legal challenges that are already being flagged by organizations like the American Civil Liberties Union.

"President Trump has recommitted himself to religious discrimination, and he can expect continued disapproval from both the courts and the people," said Omar Jadwat, director of the ACLU's Immigrant Rights Project.

Senate Democratic leader Chuck Schumer said the measure should be repealed, adding: "A watered down ban is still a ban."

Trump's first order had sparked a legal, political and logistical furor.

There was chaos at major airports and mass protests while several district courts moved to block its implementation and lawmakers expressed opposition.

The troubled rollout also dominated the first weeks of the new administration, leaving many with the impression that it was badly planned and badly implemented.

Polls show that American public opinion is deeply divided on the issue. Most indicate a slight majority of voters opposed, with strong support among Trump's political base.

The Republican president criticized a court order suspending the ban as "a very bad decision, very bad for the safety and security of our country. The rollout was perfect."

But he has now stepped away from a promise to challenge the matter in the courts. The second order repeals the first, spelling the end of any pending legal proceedings.

Whatever the legal outcome, Trump's new ban is likely to polarize opinion further and be immensely popular with his core supporters.

Iraq's inclusion in the first order prompted outrage in that country, including from Prime Minister Haider al-Abadi.

The US and Iraqi militaries are currently fighting side-by-side in northern Iraq, trying to wrest the city of Mosul from Islamic State control.

The Iraqi foreign ministry on Monday expressed its "deep satisfaction" with the new order, and described it as an "important step" in strengthening relations between Baghdad and Washington.

But the revised travel ban is also likely to sow further confusion about US immigration policies.

On Monday, Nigeria advised its citizens against all but essential travel to the United States, citing the lack of clarity on new immigration rules.

"In the last few weeks, the office has received a few cases of Nigerians with valid multiple-entry US visas being denied entry and sent back to Nigeria," said special adviser to the president Abike Dabiri-Erewa.

According to a report released Monday by travel data firm Forwardkeys, travel from the United States to the Middle East has also fallen sharply, with bookings for departure in the next three months falling 25.4 percent behind the equivalent time last year.

But the ban is likely to help Trump divert attention from rolling crises on his ties with Russia.

Since US intelligence publicly accused Russia of trying to swing the November election in Trump's favor, questions have swirled about whether some in Trump's campaign colluded with Moscow.

The last week has seen his attorney general recuse himself from election-related investigations, after it emerged he met the Russian ambassador in Washington twice during the campaign.

It has also seen Trump level unsubstantiated allegations that former president Barack Obama ordered a wiretap on the now president's phone.