In issuing his ban on immigrants from seven predominantly Muslim countries, President Trump relied on a 65-year-old provision of the federal Immigration and Nationality Act.
The provision gives presidents broad authority to ban individual immigrants or groups of immigrants. Presidents haven't hesitated to use it.
Barack Obama invoked it 19 times, Bill Clinton 12 times, George W. Bush six times and Ronald Reagan five times. George H.W. Bush invoked it once.
It's not hard to interpret the provision as a license for a president to do whatever he wants when it comes to keeping out certain people. Here's the text:
Whenever the President finds that the entry of any aliens or of any class of aliens into the United States would be detrimental to the interests of the United States, he may by proclamation, and for such period as he shall deem necessary, suspend the entry of all aliens or any class of aliens as immigrants or nonimmigrants, or impose on the entry of aliens any restrictions he may deem to be appropriate.
As the bipartisan Congressional Research Service pointed out in a report this year, the law does not place "any firm legal limits" on how it can be used. It doesn't say what factors should be considered in deciding who would be "detrimental" to U.S. interests or what constitutes "appropriate" restrictions.
There are also few court cases testing the limits of the law. That is about to change.
Trump's executive order — which blocks nationals from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen for 90 days — is facing numerous lawsuits from civil rights groups who contend that it discriminates against Muslims, violates another provision of immigration law by targeting certain nationalities and denies due process to people who already have been vetted to enter the U.S.
There are also questions about whether the order, which also keeps out refugees from around the world for 120 days and those from Syria indefinitely, actually serves its stated purpose of national security.
On Monday, U.S. Acting Atty. Gen. Sally Yates, who was appointed by Obama, told Justice Department lawyers not to defend Trump's order, arguing that she was not convinced it was lawful. Trump quickly fired her.
What is clear is that Trump's use of the law goes far beyond that of any past president. Here's how recent presidents have used it:
He turned to the provision more than any other recent president, using it to bar people who conducted certain transactions with North Korea, engaged in cyberattacks aimed at undermining democracy or contributed to the destabilization of Libya, Burundi, Central African Republic or Ukraine.
His broadest application of the law came in 2011, when he suspended entry of foreigners "who participate in serious human rights and humanitarian law violations and other abuses," including "widespread or systemic violence against any civilian population" based on, among other factors, race, color, disability, language, religion, ethnicity, political opinion, national origin, sexual orientation or gender identity.
Obama has also used the law to block anybody involved in "grave human rights abuses by the governments of Iran and Syria" through the use of communications technology to disrupt computer networks or provide monitoring or tracking.
George W. Bush
He temporarily barred foreign government officials who were responsible for failing to combat human trafficking. He also blocked those whose actions threatened Zimbabwe's democratic institutions and transition to a multiparty democracy.
Amid concerns that Syria was fomenting instability in Lebanon, Syrian and Lebanese officials deemed responsible for policies or actions that threatened Lebanon's sovereignty were also barred from entering the U.S.
He used the law to block perpetrators in the ethnic conflicts that erupted in the former Yugoslavia in the 1990s, targeting people responsible for the repression of civilians in Kosovo, along with those obstructing democracy in Yugoslavia or lending support to the Yugoslav government and the Republic of Serbia.
In 1994, he also suspended individuals and their immediate family members who were said to formulate, implement, or benefit from policies that impeded war-torn Liberia's transition to democracy. Similar suspensions were imposed on conflict-ravaged Sierra Leone in 2000.
George H.W. Bush
His sole use of the provision followed a 1991 a coup in Haiti that spurred thousands of people to flee on rickety boats and head for the U.S. Hundreds died at sea, but many were rescued, overwhelming processing centers set up at the U.S. Naval Base at Guantanamo Bay, Cuba, and aboard Coast Guard cutters.
Rather than allow Haitians to enter the United States and be screened, Bush issued an order "to enforce the suspension of the entry of undocumented aliens by sea and the interdiction of any covered vessel carrying such aliens," allowing the U.S. to intercept the boats and send the migrants back.
In October 1985, he temporarily barred entry to officers or employees of the Cuban government or the Communist Party of Cuba who held diplomatic or official passports. Focused on stamping out communism, he also targeted officers of the Cuban-backed Nicaraguan government and the ruling Sandinista National Liberation Front.
On April 7, 1980, following the storming of the U.S. Embassy in Tehran and the capture of 52 Americans who were held hostage for 444 days, he took several steps in breaking off diplomatic relations with the government of Iran. Among them was an order to ban all Iranians from entering the country. "We will not reissue visas, nor will we issue new visas, except for compelling and proven humanitarian reasons or where the national interest of our own country requires," Carter announced.
Prior to Trump's order last week, it was the broadest use of presidential authority to block a group from entering the U.S.