Mr. Faily has been directly affected by the order. Though he holds dual British and Iraqi citizenship, he said information he had received from the American Embassy in Baghdad indicated that he would not be allowed to travel to the United States in the coming weeks to participate in a long-planned conference, he said in a telephone interview from Iraq.
The edict followed inflammatory comments that Mr. Trump made during a visit to the C.I.A. this month, in which he said that the United States should have “kept” Iraq’s oil after the American-led invasion and might still have a chance to do so.
More broadly, it clashes with a memo that Mr. Trump issued on Saturday calling on the Pentagon to submit a new plan for stepping up operations against the Islamic State, including by empowering “coalition partners.”
With Iraq furnishing the ground forces for the coming assault on western Mosul, and with more than 5,000 American troops in the country, the political support of Baghdad is essential. But current and former American officials are worried that the directive will have a corrosive effect on American-Iraqi relations at a critical stage in the fighting.
“My brothers in Iraq’s Army, who I proudly fought with, are fighting ISIS tonight,” Mark Hertling, a retired Army lieutenant general who led American forces in northern Iraq, wrote on Twitter. “The Iraqi govt is now winning. And we ban their citizens?”
The order, which administration officials said was drafted without the input of Defense Secretary Jim Mattis and Middle East experts at the State Department, has offended the Iraqis in several respects.
During the Bush administration, the United States and Iraq signed a Strategic Framework Agreement, which calls for close diplomatic, economic and security ties and is still in effect.
“If I were an Iraqi, I would be waving this signed agreement in the face of the current administration,” said Ryan C. Crocker, who negotiated the accord and served as the United States ambassador to Iraq under Presidents George W. Bush and Barack Obama. “It is totally inconsistent.”
Iraqis who are already skeptical about Washington have also seized on the order to stir up opposition against the United States. Moktada al-Sadr, the fiery cleric whom many Iraqi Shiites support, accused the United States of “arrogance.”
“So get out U.S. citizens from Iraq before you expel communities from U.S.,” he said on Twitter.
To contain the political damage, officials said a long-planned call between Prime Minister Haider al-Abadi of Iraq and Mr. Trump might be arranged for this week. Mr. Trump spoke on Sunday with King Salman of Saudi Arabia and with the crown prince of the United Arab Emirates, but neither Saudi Arabia nor the Emirates are covered by the new order.
Iraqi officials who are close to the Americans worry that the Islamic State will exploit the policy in its propaganda to recruit new volunteers. As of early Sunday, the terrorist group had made no official pronouncement. However, individual members and supporters have been sharing the order and news articles about it.
Yet another worry has been expressed by veterans, and even members of Mr. Trump’s own party: that the order will interrupt the flow of former Iraqi interpreters and cultural advisers who have worked closely with the Americans and have sought special visas to move to the United States for their own protection.
“The people we need to accomplish the mission are nervous, and rightly so, that our country is going to turn our backs on them,” said Steve Miska, a retired Army colonel, who spent 40 months and three deployments in Iraq.
Senators John McCain of Arizona and Lindsey Graham of South Carolina, Republicans who have been strongly supportive of the military, expressed concern that a strict application of the order might even block Iraqi pilots from coming to the United States for training.
“This executive order bans Iraqi pilots from coming to military bases in Arizona to fight our common enemies,” they wrote in a statement issued Sunday.
The more fundamental question is whether the White House can balance the fulfillment of a campaign promise to carry out “extreme vetting” of citizens from Muslim countries with the need to maintain strong ties with Muslim partners in its fight against the Islamic State. The air bases that the United States uses to bomb the group are all in Turkey or Arab countries, as are American troops.
“The president’s actions on refugees and immigration are certain to backfire,” said Matthew G. Olsen, a former director of the National Counterterrorism Center. “The policies validate the terrorists’ claim that we are at war with Islam, and will alienate our Middle East allies and isolate American Muslims here at home.”