The version of President Trump’s travel ban that finally went into effect last week is a far cry from the administration’s original vision for curtailing immigration and beefing up national security.

It’s been a long and bumpy road for the controversial policy, which has been bogged down by legal challenges, revised by government lawyers and further narrowed by the Supreme Court.

The new travel restrictions that are now in place include a patchwork of exemptions for refugees and foreign nationals trying to enter the United States, while the White House shed some of the most contentious language from the executive order.

Here is the evolution of Trump's travel ban.

Original executive order

Trump issued an executive order in January shortly after taking office aimed at temporarily banning travel from certain countries while the U.S. government reviewed and strengthened its vetting procedures.

The effort was supposed to be a signature policy achievement for Trump, who called for banning all Muslims from entering the U.S. when he was on the campaign trail.

Trump’s order barred people from Iraq, Iran, Syria, Yemen, Libya, Sudan and Somalia from entering the U.S. for 90 days; halted the U.S. refugee resettlement program for 120 days; and indefinitely suspended resettlement of refugees from Syria.

ADVERTISEMENT

It also reduced the cap on the number of refugees that can be accepted into the U.S. to 50,000 in 2017.

The policy, which was reportedly drafted without input from key officials and lawmakers, went into effect immediately and without advance notice, sparking widespread chaos and protests at airports around the country.

Some travelers and legal U.S. residents who were caught in transit when the executive order came down were detained upon entering the country due to the confusion.

There was a fierce global backlash to the ban, with world leaders quick to condemn the policy and Iraq even mulling retaliatory measures.

The legal challenges quickly began to pile up for Trump’s young administration. A federal judge in Washington state put the entire travel ban on hold, one week after it was put in place.

And a San Francisco-based appeals court refused to lift the nationwide restraining order against the ban, delivering a major blow to the administration.

“SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE!” Trump tweeted.

Travel ban 2.0

Instead of taking the case to the Supreme Court, however, the White House went back to the drawing board.

This time around, government lawyers helped craft a new travel ban that was specifically tailored to stand up in court, using the previous rulings as a playbook.

Trump signed a revised order behind closed doors in March that gave agencies and stakeholders more than a week to prepare for the new changes, while revoking the initial version of the ban.

The White House dropped Iraq from the list of targeted countries, explicitly exempted legal permanent residents and those who already have a valid visa to come to the U.S. and removed the indefinite restriction on the admission of Syrian refugees.

The administration also stripped language that would have given preference to religious minorities — such as Christians from the Middle East — once refugee resettlement resumes. That provision gave fuel to critics who labeled the previous order a Muslim ban.

And travel ban 2.0 included a specific list of who may qualify for a waiver to the executive order, which the order said could be provided on a case-by-case basis.

The examples were squarely aimed at some of the most controversial cases of travelers being turned away, such as an Iranian baby with a serious heart defect whose family was en route to get medical care in the U.S. when they got caught up in the initial travel ban.

But despite the key changes, core components of the revised ban were still put on ice by two different federal judges before it even took effect. The 4th and 9th Circuits largely agreed to uphold the lower court rulings, though the appeals courts found different reasons to do so.

The administration asked the Supreme Court to step in, but had to tweak the policy so that it wouldn’t expire in the meantime.

A frustrated Trump lashed out in early June over the revised ban still being held up in the court system.

“The Justice Dept. should have stayed with the original Travel Ban, not the watered down, politically correct version they submitted to S.C.,” the president wrote on Twitter.

New limited version of the ban

Five months after Trump signed the first travel ban, the Supreme Court decided to allow a limited version of the order take effect last Thursday, delivering a win to the administration.

The high court also agreed to hear the government’s appeal of the lower court rulings that froze the ban.

“Today’s unanimous Supreme Court decision is a clear victory for our national security,” Trump said in a statement. “It allows the travel suspension for the six terror-prone countries and the refugee suspension to become largely effective. As President, I cannot allow people into our country who want to do us harm.”

But the Supreme Court carved out new criteria that even further narrowed the scope of the revised ban’s reach.

Justices said that the ban could only apply to refugees and travelers who do not have a “bona fide” relationship to a person or entity in the U.S.

The administration issued guidance to clarify exactly who is and isn’t covered under the new criteria.

Travelers from affected countries can only come to the U.S. to visit spouses, fiancés, parents, parents-in-law, children, adult sons or daughters, siblings, step- or half-siblings, or sons- and daughters-in-law.

The policy excludes entry for visiting cousins, grandparents, grandchildren, aunts, uncles, nieces, nephews, and brothers- and sisters-in-law.

The White House originally excluded fiancés from the definition, but abruptly reversed course Thursday evening following outcry over the issue. Grandparents, another category left off the list and drawing scrutiny, are still not considered close family however.

Senior officials emphasized that determinations will be made on a case-by-case basis, which suggests that there could be some wiggle room - a stark contrast from the blanket ban that was issued in January.

“If they don’t have the requisite family relationship, if they would like to articulate a reason that we should nevertheless waive the inadmissibility, they are certainly welcome to articulate that reason to us,” officials said. “And we will look at those cases case by case, but it won’t be the relationship that will be the determining factor.”