San Francisco - President Donald Trump's travel ban faced its biggest legal test yet on Tuesday as a panel of federal judges prepared to hear arguments from the administration and its opponents about two fundamentally divergent views of the executive branch and the court system.The government will ask a federal appeals court to restore the administration's executive order, contending that the president alone has the power to decide who can enter or stay in the United States. But several states have challenged the ban and insisted that Trump's executive order is unconstitutional.Tuesday's hearing was to unfold before a randomly selected panel of judges from the San Francisco-based 9th US Circuit Court of Appeals. Whatever the appeals court decides, either side could ask the Supreme Court to intervene.Borders secureSeattle US District Judge James Robart, who on Friday temporarily blocked Trump's order, has said a judge's job is to ensure that an action taken by the government "comports with our country's laws."Trump said on Tuesday that he can't believe his administration has to fight in the courts to uphold his refugee and immigration ban, a policy he says will protect the country."And a lot of people agree with us, believe me," Trump said at a round table discussion with members of the National Sheriff's Association. "If those people ever protested, you'd see a real protest. But they want to see our borders secure and our country secure."The Justice Department on Monday filed a new defence of the ban on travellers from seven predominantly Muslim nations. Lawyers said the ban was a "lawful exercise" of the president's authority to protect national security and said Robart's order should be overruled.The filing with the appeals court was the latest salvo in a high-stakes legal fight surrounding Trump's order.Washington state, Minnesota and other states say the appellate court should allow a temporary restraining order blocking the travel ban to stand as their lawsuit moves through the legal system.The panel hearing the arguments includes two Democrat-appointed judges and one Republican appointee.Orderly reviewThe appeals court over the weekend refused to immediately reinstate the ban and lawyers for Washington and Minnesota argued anew on Monday that any resumption would "unleash chaos again," separating families and stranding university students.The Justice Department responded that the president has clear authority to "suspend the entry of any class of aliens" to the US in the name of national security. It said the travel ban, which temporarily suspends the country's refugee programme and immigration from seven countries with terrorism concerns, was intended "to permit an orderly review and revision of screening procedures to ensure that adequate standards are in place to protect against terrorist attacks."The challengers of the ban were asking "courts to take the extraordinary step of second-guessing a formal national security judgment made by the president himself pursuant to broad grants of statutory authority," the Justice Department wrote.