Washington (CNN) US President Donald Trump signed a new executive order Monday that bans immigration from six Muslim-majority countries, dropping Iraq from January's previous order, and reinstates a temporary blanket ban on all refugees.

The new travel ban comes six weeks after Trump's original executive order caused chaos at airports nationwide before it was blocked by federal courts. It removes out language in the original order that indefinitely banned Syrian refugees and called for prioritizing the admission of refugees who are religious minorities in their home countries. That provision drew criticism of a religious test for entry and would have prioritized Christians over Muslims fleeing war-torn countries in the Middle East.

The new ban, which takes effect March 16, also explicitly exempts citizens of the six banned countries who are legal US permanent residents or have valid visas to enter the US -- including those whose visas were revoked during the original implementation of the ban, senior administration officials said.

"We cannot compromise our nation's security by allowing visitors entry when their own governments are unable or unwilling to provide the information we need to vet them responsibly, or when those governments actively support terrorism," Attorney General Jeff Sessions said Monday.

The new measures will block citizens of Syria, Iran, Libya, Somalia, Sudan and Yemen from obtaining visas for at least 90 days. The order also suspends admission of refugees into the US for 120 days, directing US officials to improve vetting measures for a program that is already widely regarded as extremely stringent.

Trump signed the executive order earlier Monday in the Oval Office outside the view of reporters and news cameras, after more than three weeks of repeated delays, the latest of which came after White House officials decided last week to delay the signing to avoid cutting into positive coverage of Trump's joint address to Congress.

The delays also came amid an intense lobbying effort from Iraqi government officials, including from the country's prime minister, to remove Iraq from the original seven-state list of banned countries.

Secretary of State Rex Tillerson said Iraq's removal from the list came after an intense review from the State Department to improve vetting of Iraqi citizens in collaboration with the Iraqi government, though he did not specify how vetting had been improved.

"The United States welcomes this kind of close cooperation," he said. "This revised order will bolster the security of the United States and our allies."

The rollout of the revised travel ban marks an important moment for the administration, which has little room for error after the chaotic debut of the original plan. That failure raised questions about the new White House's capacity to govern and to master the political intricacies needed to manage complicated political endeavors in Washington. It also brought Trump into conflict with the judiciary in the first sign of how constitutional checks and balances could challenge his vision of a powerful presidency built on expansive executive authority.

The original order came under intense criticism as an attempt to bar Muslims from entering the country, and Trump's call during the campaign for a "Muslim Ban" was cited in court cases attacking the ban.

The new order does not prioritize religious minorities when considering refugee admissions cases.

Administration officials Monday stressed they do not see the ban as targeting a specific religion.

"(The order is) not any way targeted as a Muslim ban ... we want to make sure everyone understands that," an official told reporters.

"The Department of Justice believes that this executive order just as the first executive order is a lawful and proper exercise of presidential authority," Sessions said.

Democrats responded by calling Trump's order a repeat version of the first attempt.

"Here we go again...Muslim Ban 2.0 #NoBanNoWall" tweeted Rep. Andre Carson of Indiana, one of two Muslims serving in the House of Representatives.

Working to contain fallout

The newly crafted order also revealed that the administration wasn't just paying attention to the legal criticism in the courts, but also recalibrating in light of the heavy political fire they faced after the first order's messy rollout.

While administration lawyers argued the original travel ban went into effect immediately to prevent terrorists from rushing into the country, the revised ban will phase in after 10 days. The previous order will be rescinded on that date.

Trump had previously said he opposed giving any advance notice of the ban.

"If the ban were announced with a one week notice, the "bad" would rush into our country during that week. A lot of bad "dudes" out there!" he tweeted on January 30

The White House also abandoned the sense of urgency with which it implemented the first travel ban, delaying the signing of a new executive order multiple times over the last three weeks. Politics also came into play as White House officials delayed the signing from last Wednesday in part to allow positive coverage of the President's joint address to Congress to continue uninterrupted.

"We want the (executive order) to have its own 'moment,'" a senior administration official told CNN last week.

The President signed the action Monday morning without the fanfare he has given to other executive orders. No media was present during the signing at the White House, an administration official confirmed. White House spokesman Sean Spicer tweeted a picture of Trump signing the order.

White House officials collaborated for several weeks with officials at the Department of Homeland Security, the Justice Department and kept congressional leaders apprised of their progress this time around after the White House drew a backlash for keeping Congress and relevant federal agencies almost entirely in the dark during the first rollout.

To bolster its national security claims, the new executive order also states FBI has reported that approximately 300 people who entered the United States as refugees are "currently the subjects of counter-terrorism investigations."

"The fact remains that we are not immune to terrorist threats and that our enemies often use our own freedoms and generosity against us," Homeland Security Secretary John Kelly said. "We cannot risk the prospect of malevolent actors using our immigration system to take American lives."

Rep. Adam Schiff, the top Democrat on the House Intelligence committee, said the ban "has the same fundamental flaws" as the first order.

"We know that country of origin is a poor predictor of a propensity to commit acts of terror. If it were, Pakistan has been a far more problematic source of attack planning and would be at the top of the President's list, but that country merits not even a mention in the order," Schiff said in a statement.

Why Iraq was removed

But the new order was also delayed in part because of a debate within the administration over how to handle Iraq.

Tillerson, Secretary of Defense James Mattis and national security adviser Gen. H.R. McMaster had all advocated for Iraq to be removed from the Trump administration's list of banned countries in the new executive order for diplomatic reasons, including Iraq's role in fighting ISIS, sources told CNN's Elise Labott and Evan Perez. Homeland Security Secretary John Kelly also supported the move.

Iraq was removed from the revised travel ban executive order after intensive lobbying from the Iraqi government at the highest levels, according to a senior US official.

That included a phone call between Trump and Iraqi Prime Minister Haider al-Abadi on February 10 and an in-person conversation between Abadi and Vice President Mike Pence in Munich on February 18.

Those conversations were followed by discussions between Tillerson and members of the Iraqi government about vetting measures in place that would prevent suspected terrorists from leaving Iraq and coming to the United States. Iraq did not implement new measures; rather, the country provided more detail to US officials about how it screens travelers.

In Trump's call with Abadi, the President vowed to seek a resolution to his counterpart's concerns about his citizens' being unable to enter the United States, according to a readout of the phone call from Baghdad. The US official said Trump asked Tillerson to get greater clarity on vetting measures in Iraq.

Trump also faced pressure to remove Iraq from the order from some American national security officials, who argued the restriction burdened a key anti-ISIS partner. Some of those voices were holdovers from the Obama administration.

Iraq's Foreign Ministry welcomed reports of its removal from the list of countries affected by the travel ban.

"(The) Iraqi Foreign Ministry expresses deep relief regarding the executive order that was issued by the American president Donald Trump, which excludes the Iraqis from the travel ban to the United States," said Iraqi Foreign Ministry spokesperson, Ahmad Jamal. "This is considered an important step in the right direction that strengthen and reinforces the strategic alliance between Baghdad and Washington in many fields, in particular the fight against terrorism."

This story is breaking and will be updated.

CORRECTION: This story has been updated to correct Kelly's name.