One of the main criticisms of Donald Trump’s proposed moratorium on Muslim immigration is that it’s unconstitutional. For example, Republican presidential candidate and law graduate Marco Rubio said that the plan “violates the Constitution” earlier this week.

However, two notable law professors — Jan C. Ting of Temple University and Eric Posner of the University of Chicago — say those critics are wrong and possibly don’t know much about legal history.

Ting, a professor at Temple University’s School of Law and a former Immigration and Naturalization Services commissioner for the Department of Justice, explained to The Daily Caller that Trump’s plan is in keeping with over a hundred years of legal precedent.

“No kind of immigration restriction is unconstitutional,” Ting told TheDC. “The U.S. government can exclude a foreign national on any basis.”

The legal scholar explained that the Supreme Court’s decisions since ruling unanimously in favor of the legality of the Chinese Exclusion Act in 1889 have upheld the authority of the political branches — executive and legislative — to make immigration law as they see fit and to exclude foreigners on grounds that would not be applicable to American citizens.

“The statutes are clear: immigration is different from all other aspects of the law,” Ting said. “The Supreme Court has ruled we can enact laws against foreign nationals that would not be permissible to apply to citizens. The courts historically have no role in these decisions.”

If a President Trump was able to enact his Muslim moratorium, Ting said that “it’s unlikely for the [Supreme] Court to reverse 100 years of legal history and overturn it. It would be giving foreign nationals civil and constitutional rights to do so.”

He said that the courts have upheld this arrangement as recently as 2015 and that major cases — such as the U.S. District Court of Appeals for the District of Columbia affirming the constitutionality of then-President Jimmy Carter’s ban on Iranian immigrants in 1980 — have hewed to the viewpoint that Congress and the president can exclude foreigners on any possible basis from America.

The Temple professor specifically cited the ability for the government to discriminate on the basis of race and ethnicity when it comes to immigration — pointing out that it happens “everyday.”

Ting noted that the United States has a diversity visa lottery that excludes applicants specifically due to their national origin and ethnicity.

He cites the fact that thousands of Mexican and Filipino applicants have to “wait in line for years” because our our visa system refuses to take them in simply due to their national origin. The reason for their exclusion is because of the already-high number of immigrants coming to America from those countries and the caps in place to keep one country’s pool of applicants from exceeding seven percent of the total number of accepted migrants in a year.

Ting also brought up the 1972 Supreme Court case affirming the right of the government to exclude a Belgian Marxist writer from the country due to his intellectual beliefs and which could be precedent applied to those adhering Islamic fundamentalism.

Ting ridiculed another criticism of Trump’s plan: that it is “un-American.”

“It reminds me of the House Un-American Activities Committee. ‘We know what’s American. Only my ideas qualify as American,'” he told TheDC.

He concluded that the “un-American” line of attack is in no way “legally significant.”

Eric Posner, a professor at the University of Chicago Law School and the fourth-most cited legal expert in the U.S., agreed with the constitutionality of Trump’s proposed moratorium in two blog posts on his website.

Posner said in a Tuesday post that, “constitutional protections that normally benefit Americans and people on American territory do not apply when Congress decides who to admit and who to exclude as immigrants or other entrants,” and Trump’s proposal was “probably not” unconstitutional.

While admitting that there is no specific precedent for exclusion based on religious affiliation, Posner managed to cite a Congressional measure passed in 1891 that “made inadmissable people who practice polygamy (directed, at the time, at Mormons).” No court ever found the statue unconstitutional.

In a second post Tuesday, Posner said that Trump could enforce his ban without the permission of Congress if he could prove that Muslim immigration posed a threat to the country. According to the legal scholar, past court cases show that The Donald could possibly prove this case from a legal perspective.

While Ting expressed sympathy for Trump’s moratorium, Posner appears to not be so thrilled by the plan or the prospect of Trump in the White House.

“The bottom line: if you (like me) don’t want Trump to block Muslims from entering the United States, then stop him from getting elected president. Don’t depend on the Constitution, Congress, or the courts,” the Chicago-based law professor concluded his second post.

Follow Scott on Twitter