Washington — The legal fight over President Donald Trump's ban on refugees is likely to turn on questions of a president's authority to control America's borders and on whether the new immigration policy unconstitutionally discriminates against Muslims.Civil liberties advocates have challenged the order, which temporarily suspends immigration from seven countries and the United States' broader refugee program. It has drawn nationwide protests since the order was issued on Friday.Federal judges in New York and several other states issued orders that temporarily block the government from deporting people with valid visas who arrived after Trump's travel ban took effect. Acting Attorney General Sally Yates, a Democratic appointee, said on Monday she has directed Justice Department attorneys to not defend Trump's order, as she is not convinced it is lawful. Trump responded by swiftly firing her and replacing her with Dana Boente, US Attorney for the Eastern District of Virginia.Washington state's attorney general announced he's suing Trump over the order.And the Council on American-Islamic Relations also filed a lawsuit arguing the ban violates the First Amendment's bar of preferential treatment for a religion — by appearing to favour Christian over Muslim refugees."While this ban does not apply to all Muslims, it only applies to Muslims," said Gadir Abbas, one of the council's lawyers. "That type of religious gerrymandering is illegal."The court cases are only beginning, and legal experts are divided as to whether courts will find Trump's action constitutional.Federal law gives the president unconstrained power to suspend the entry of "any class of aliens" if he determines their entry "would be detrimental to the interests of the United States". But a different law prevents discrimination against the issuance of an immigrant visa based on a person's nationality or place of birth.Broad discretion"Historically, the courts have not tried to regulate the executive branch's determination as to who's allowed to enter the country," said Eric Posner, a University of Chicago law professor. "The immigration statute gives the president very broad discretion to block people from entering the country," including for national security reasons.Posner said he expected judges to give the policy more deference if the administration can show that it was done to protect national security, rather than for political reasons.He also said courts could find it compelling that the executive order is temporary rather than permanent, and that it does not cover all Muslims from all countries, notably omitting Saudi Arabia — the home nation for the majority of the September 11 hijackers."The fact that he lets in Muslims from Saudi Arabia tends to undermine the theory that he's acting out of animus," Posner said.Trump isn't the first American leader to apply a different standard to Saudi Arabia. Its status as the world's leading oil producer and close US ally has led Republicans and Democrats to often overlook its woeful human rights record and spotty history in fighting terrorism. The travel ban applies to Syria, Iraq, Iran, Libya, Somalia, Yemen and Sudan.Courts have a long history of upholding portions of immigration law that discriminate on the basis of race and nationality, said Peter J. Spiro, a law professor at Temple University. As far back as 1889, the Supreme Court upheld the exclusion of Chinese labourers, and more recent rulings have also upheld similar discrimination.The court, for example, ruled in 1953 that a noncitizen trying to enter the US has no right under the Constitution to challenge the government's decision to deny entry. That case involved a legal permanent resident of the United States who travelled abroad to Hungary for 19 months. He was denied re-entry because the government said he posed a threat to national security.Public backlashBut that case and others were decided at a time when the public was more accepting of discriminatory policies.Adam Cox, a law professor at New York University, said it's historically been challenging to prove that a policy was enacted with the purpose of disadvantaging a particular religion or race, often requiring "smoking gun evidence of the state of mind of the people" behind it. He said that though courts in the past have sustained discriminatory policies, it could be possible for a judge in this instance to "pierce the veil" and decide that the executive order was motivated by animus."If a court gets to the point where it sees this as open discrimination on the basis of religion or race, at that point I would part company with people who argue that simply by virtue of this being an immigration policy, it is insulated from constitutional attack," Cox said.It's also possible that federal judges could be more likely to push back in light of the massive public backlash over Trump's ban, Spiro said."If there's going to be a case in which a constitutional challenge has some chance of succeeding, this is it," he said.