A San Francisco-based federal appeals court heard arguments Tuesday night as the Justice Department attempted to overturn a district court judge's order halting President Donald Trump's executive order on immigration.

Fox News senior judicial analyst Andrew Napolitano joined "America's Newsroom" Wednesday to give his take on the hearing.

"My impression is that the president has a very legitimate complaint that the judges sounded political," Napolitano said.

Pres. Trump Defends Travel Ban: 'Courts Seem to Be So Political'

Huckabee: Travel Ban Is a Speed Bump for Immigrants, Not a Stop Sign

'Focus on American Workers First': Cotton's Bill Would Cut Legal Immigration in Half

He said the judges from the 9th Circuit Court of Appeals -- Judge Michelle Friedland, Judge William Canby Jr. and Judge Richard Clifton -- asked irrelevant questions that focused on the "wisdom" of Trump's executive order, which is not their job to decide.

"My late friend, the great Justice [Antonin] Scalia, used to have as a joke a sign on his desk with three words on it: 'Stupid but Constitutional.' Basically saying I don't care what the government did. I only care if it's constitutional," Napolitano said.

Speaking Wednesday morning, Trump said even a "bad high school student" would understand that he has the authority to restrict travel from certain nations in the interest of national security.

"I listened to a bunch of stuff last night on television that was disgraceful," Trump said of the hearing.

Napolitano said Trump's complaints are "perfectly valid" since the White House is arguing that this is a national security issue.

A ruling, which could be appealed to the Supreme Court, is expected sometime later in the week.

Watch the judge's full remarks in the video above.

Krauthammer: Trump's Travel Ban Was 'Unnecessary Overshoot'

NY Dems Respond to Trump by Passing 'Sanctuary State' Bill

'Hannity' Exclusive: Border Patrol Agent Offers In-Depth Look at Drug Smuggling