Many Americans are up in arms. But in fact, keeping out desperate souls seeking entry into America has deep roots. On this day 100 years ago, the United States passed the strictest immigration law of its time: the Immigration Act of 1917.

The law restricted the immigration of "undesirables," including many people from the Middle East and Asia, through increased taxes, tests and outright bans.

Trump's ban, which has prompted nationwide protests and widespread condemnation , is eerily similar -- targeting some of the same people and imposing tests in the form of "extreme vetting," according to observers.

"In some ways this is kind of back to the future," said Kevin Johnson, an immigration law expert and dean at the UC Davis School of Law.

What was the Immigration Act of 1917?

The Immigration Act barred an ambiguous and long list of people from entering the country.

According to the law, these included "all idiots, imbeciles, feeble-minded persons, epileptics, insane persons ... persons with chronic alcoholism; paupers, professional beggars," and those with tuberculosis and other contagious diseases. It barred felons, polygamists, prostitutes and their traffickers, and -- similar to Trump's ban -- it blocked entry to those who "advocate the overthrow by force or violence of the Government of the United States, or of all forms of law" and anyone who would "advocate or teach the duty, necessity, or propriety" of killing of US officers or officials.

To keep these people out, the law raised the tax imposed on most adult entrants. It also imposed a literacy test, requiring newcomers older than 16 to demonstrate basic reading comprehension in any language.

US inspectors examine the eyes of immigrants at Ellis Island in New York Harbor, in the early 1900s.

Moreover, the law kept out people from what it called the "Asiatic Barred Zone," which included modern day India, Afghanistan, Iran, Saudi Arabia, Russia, Southeast Asia and the Asian-Pacific islands.

China was not included, but the Chinese were already denied immigration visas under the 1882 Chinese Exclusion Act -- which became more discriminatory over the years until it was repealed in 1943 after Beijing became a World War II ally.

Exempt were Japan and the Philippines. The former had voluntarily limited its peoples' immigration to the United States in 1907. The latter was a US colony at the time.

Who supported the law and why?

US lawmakers who drafted and passed the immigration law characterized it as necessary for the country's security. With World War I in full swing, the issue of national security was on everyone's mind.

Photos: World War I: A time of upheaval Photos: World War I: A time of upheaval French soldiers sing the national anthem at the beginning of World War I in August 1914. This "war to end all wars" might seem like ancient history, but it changed the world forever. It transformed the way war was fought, upended cultures and home life and stimulated innovations that affect us today. With more than 30 combatant nations and nearly 70 million men mobilized, World War I profoundly destabilized the international order. Look back at some of the war's key events. Hide Caption 1 of 25 Photos: World War I: A time of upheaval The bodies of Austria-Hungary Archduke Franz Ferdinand and his wife, Sophie, Duchess of Hohenberg, are seen after their assassination by Serbian nationalist Gavrilo Princip on June 28, 1914. The assassination led Austria-Hungary to declare war on Serbia, starting a chain of events that would gradually bring other nations into the fray. Hide Caption 2 of 25 Photos: World War I: A time of upheaval Germans in Berlin mobilize for war on August 1, 1914. Germany was a strong ally of Austria-Hungary. Hide Caption 3 of 25 Photos: World War I: A time of upheaval French soldiers are seen at a front-line trench in Italy. During World War I, the Allied Powers consisted of Belgium, France, Great Britain, Greece, Italy, Montenegro, Portugal, Romania, Russia, Serbia and the United States. The Central Powers consisted of Austria-Hungary, Bulgaria, Germany, and Ottoman Empire (now Turkey). Hide Caption 4 of 25 Photos: World War I: A time of upheaval German soldiers captured by the British are seen in France. Hide Caption 5 of 25 Photos: World War I: A time of upheaval Men visit the graves of French soldiers killed in the Battle of the Marne in September 1914. Hide Caption 6 of 25 Photos: World War I: A time of upheaval Troops land at Anzac Cove in the Dardanelles during the battle between Allied forces and Turkish forces at the Gallipoli Peninsula in February 1915. The two sides were fighting for access to the strategic Sea of Marmara and eventually to Constantinople (Istanbul). Hide Caption 7 of 25 Photos: World War I: A time of upheaval German and British troops are seen together during the Christmas Truce of 1914. Hide Caption 8 of 25 Photos: World War I: A time of upheaval These French Zouave infantrymen were killed by gas during the Second Battle of Ypres, Belgium, in April 1915. Hide Caption 9 of 25 Photos: World War I: A time of upheaval Germans give oxygen to a gas victim in 1915. The cloth masks worn by these soldiers provided little defense; more substantial gas masks were not produced until 1916. By the end of the war, even horses and dogs used at the front had their own gas masks. Hide Caption 10 of 25 Photos: World War I: A time of upheaval German U-boats, or submarines, patrol the Mediterranean coast. Hide Caption 11 of 25 Photos: World War I: A time of upheaval French troops rest in Verdun, France, in 1916. Verdun was the site of the longest battle of World War I. Hide Caption 12 of 25 Photos: World War I: A time of upheaval Dead bodies lie piled in a trench at Verdun on April 9, 1916. Hide Caption 13 of 25 Photos: World War I: A time of upheaval British troops advance during the Battle of the Somme in 1916. Hide Caption 14 of 25 Photos: World War I: A time of upheaval A British tank is stranded while crossing a trench during the Battle of the Somme on September 25, 1918. Hide Caption 15 of 25 Photos: World War I: A time of upheaval German soldiers stand near a crashed fighter plane in Germany in 1916. Hide Caption 16 of 25 Photos: World War I: A time of upheaval Czar Nicholas II of Russia, right, reviews the palace guard just prior to the Russian Revolution of 1917. Hide Caption 17 of 25 Photos: World War I: A time of upheaval U.S. President Woodrow Wilson addresses a joint session of Congress in April 1917, requesting a declaration of war on Germany. The United States declared war against Germany after the interception and publication of the Zimmermann Telegram and the sinking of three U.S. merchant ships by German U-boats. Hide Caption 18 of 25 Photos: World War I: A time of upheaval Britons stand in line outside an Army recruiting station. Hide Caption 19 of 25 Photos: World War I: A time of upheaval A British sergeant major instructs American soldiers in bayonet fighting at Texas' Camp Dick. Hide Caption 20 of 25 Photos: World War I: A time of upheaval U.S. Army troops stand in a defensive trench in France. By war's end, thousands of miles of trenches crisscrossed European battlefields. Hide Caption 21 of 25 Photos: World War I: A time of upheaval A defeated German army marches home on October 1, 1918. Hide Caption 22 of 25 Photos: World War I: A time of upheaval Armistice Day is celebrated in Chicago on November 1, 1918. Hide Caption 23 of 25 Photos: World War I: A time of upheaval U.S. troops returning home from France are seen on the USS Agamemnon in Hoboken, New Jersey, in 1919. Hide Caption 24 of 25 Photos: World War I: A time of upheaval German delegates listen to French Prime Minister Georges Clemenceau's speech during the signing of the Treaty of Versailles in France on June 28, 1919. Hide Caption 25 of 25

"There was domestic anxiety and uncertainty and frustration and the Soviet Union was being formed," said Johnson, author of "The Huddled Masses Myth: Immigration And Civil Rights."

"There was a Red Scare on the horizon. There were political tensions. There was a concern with widespread immigration."

The State Department's Office of the Historian adds: "The uncertainty generated over national security during World War I made it possible for Congress to pass this legislation."

Domestically, Johnson said the law was fairly popular.

"In 1917, segregation and Jim Crow is alive and well and keeping out Chinese from the country and all Asians seems as normal and natural as apple pie," he said.

What did critics say?

The immigration law did not pass unopposed. In fact, it was vetoed by President Woodrow Wilson, but Congress overrode the veto.

Wilson argued that the law contradicted US values and prevented good people from joining American society.

The Immigration Act of 1917 was vetoed by President Woodrow Wilson.

In vetoing an earlier version of the act , Wilson said it would "all but close entirely the gates of asylum which have always been open to those who could find nowhere else the right and opportunity of constitutional agitation for what they conceived to be the natural and inalienable rights of men."

"Restrictions like these, adopted earlier in our history as a Nation, would very materially have altered the course and cooled the humane ardors of our politics," he wrote.

"The right of political asylum has brought to this country many a man of noble character and elevated purpose who was marked as an outlaw in his own less fortunate land, and who has yet become an ornament to our citizenship and to our public councils."

International reaction to the law was also harsh, with many of the named countries condemning the law, Johnson said.

How is Trump's immigration ban similar?

JUST WATCHED Trump: We don't want them here Replay More Videos ... MUST WATCH Trump: We don't want them here 02:50

On January 27, Trump signed an executive order that suspended immigration from seven Muslim-majority countries for 90 days, halted the US refugee program for 120 days and indefinitely barred Syrian refugees from entering the United States.

"I hereby proclaim that the entry of nationals of Syria as refugees is detrimental to the interests of the United States and thus suspend any such entry," Trump's order reads. Other countries impacted included Iran, Iraq, Sudan, Libya, Yemen and Somalia.

The order also instituted screening tests on refugees and immigrants to see if they held American values. The President has described the process as " extreme vetting ."

"I am establishing new vetting measures to keep radical Islamic terrorists out of the United States of America," Trump said during the signing at the Pentagon. "We don't want them here."

The total number of refugees admitted into the United States was also capped during the 2017 fiscal year at 50,000, down more than half from the current level of 110,000.

The order followed Trump's campaign promise to tighten borders and stop certain refugees from entering the United States.

Although the the Immigration Act of 1917 is more far-reaching than Trump's order, observers say they're similar in at least three ways: First, supporters of both argued the restrictions were necessary for national security. Second, the restrictions imposed a type of test. Third, the bans seemingly discriminate against people based on their national origin.

What was the impact?

It's difficult to quantify the impact of immigration bans . When refugees and immigrants are barred from entering countries, persecuted people cannot escape danger and may be harmed or killed, families are separated , opportunities are lost and finances spent on travel are squandered. Host countries may also lose out on labor, knowledge and expertise that could potentially strengthen their societies and economies.

In fact, the Immigration Act of 1917 was challenged by businesses in the Southwest that said literacy tests barred much-needed Mexican laborers from entering the country.

Trump's executive order banning certain immigrants also risked preventing students from finishing academic programs and doctors from returning to their jobs in American hospitals . It also prevented sick people from receiving life-saving treatment.

Iranian infant Fatemeh Reshand , for example, almost missed the opportunity to receive medical treatment for a serious heart defect. It took much lobbying from family members and community leaders to grant her and her parents a medical exemption.

JUST WATCHED Trump travel ban leaves baby in limbo Replay More Videos ... MUST WATCH Trump travel ban leaves baby in limbo 01:36

Where do these laws stand now?

The Immigration Act of 1917 was revised by the Immigration and Nationality Act of 1952, also known as the McCarran-Walter Act. The law abolished racial restrictions but retained quotas for nationalities and regions. It also established a preference system that placed higher value on some nationalities and immigrants with specific labor skills.

As for Trump's executive order on immigration, it was temporarily halted Friday by a federal judge. The Department of Homeland Security then suspended implementation of the order, saying it would resume standard inspections of travelers as it did prior to the ban.