A federal appeals court has refused to reinstate US President Donald Trump's ban on travellers from seven predominantly Muslim nations, dealing another blow to his young administration.

In a unanimous decision, the panel of three judges from the San Francisco-based 9th US Circuit Court of Appeals declined on Thursday to block a lower-court ruling that suspended the ban and allowed previously barred travellers to enter the US.

Shortly after the ruling, Trump responded furiously on Twitter, writing his response in capital letters.

SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE! — Donald J. Trump (@realDonaldTrump) February 9, 2017

He told reporters his administration ultimately would win the case and dismissed the ruling as "political".

Trump's January 27 order barred travellers from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen from entering for 90 days and all refugees for 120 days, except those from Syria, whom he would ban indefinitely. He said his directive was "done for the security of our nation, the security of our citizens."

District Judge James Robart in Seattle issued a temporary restraining order on the ban on February 4 after Washington and Minnesota states sued, prompting Trump to label him a "so-called judge".

The 9th Circuit judges noted that the states had raised serious allegations about religious discrimination.

Asked about Trump's tweet, Washington state Attorney General Bob Ferguson said: "We have seen him in court twice, and we're two for two."

An appeal to the Supreme Court is possible.

A point-by-point rebuttal

In its ruling on Thursday, the 9th US Circuit rejected the administration's claim that the court did not have the authority to review the president's executive order.

"There is no precedent to support this claimed unreviewability, which runs contrary to the fundamental structure of our constitutional democracy," it said.

Al Jazeera's Rob Reynolds, reporting from San Francisco, said the court presented "a point-by-point rebuttal of the government's case in the ruling".

Speaking to Al Jazeera, Melanie Sloan, a consultant and a longtime ethics monitor in Washington DC, said: "This tells the world that there is a significant portion of our country that is not behind this kind of thing at all.

"We will work very, very hard to defeat this kind of discriminatory ban that really doesn't help anybody."

Justice Robart's ban order temporarily suspended the nation's refugee programme and immigration from countries that the Trump administration says raise security concerns.

Justice department lawyers appealed to the 9th US Circuit, arguing that the president has the constitutional power to restrict entry to the US and that the courts cannot second-guess his determination that such a step was needed to prevent terrorism.

The states, however, said Trump's travel ban harmed individuals, businesses and universities.

Citing Trump's campaign promise to stop Muslims from entering the US, they said the ban unconstitutionally blocked entry to people based on religion.

Both sides faced tough questioning during an hour of arguments on Tuesday conducted by phone - an unusual step - and broadcast live on cable networks, newspaper websites and social media. It attracted a huge audience.

The judges chipped away at the administration's claim that the ban was motivated by "terrorism fears", but they also challenged the states' argument that it targeted Muslims.

Sloan, the Washington DC-based ethics monitor, said: "It's really wonderful. As an American I can be so proud of these folks and the image we want to project to the world.

"I think you will see, going forward in the Trump administration, that often it will be lawyers and judges who will be on the forefront, stopping these abuses of power. Remember we are only in Week Three of the administration."

Justice Robart temporarily halted the ban after determining that the states were likely to win the case and had shown that the ban would restrict travel by their residents, damage their public universities and reduce their tax base.

'Thoughtful opinion'

Robart put Trump's executive order on hold while the lawsuit worked its way through the courts.

After that ruling, the state department quickly said people from the seven countries with valid visas could travel to the US.

Commenting on the 9th Circuit decision, Noah Purcell, Washington state's solicitor general, described it as an "excellent, well-reasoned, careful, thoughtful opinion that seriously considered all the government's arguments - and rejected them".

He said it is "important to recognise the real impact that this is already having on people's lives. We have just been hearing from people all over the state and all of the country about what a difference this has made, and we're so thrilled for that".

The Supreme Court has a vacancy, but there is no chance Trump's nominee, Neil Gorsuch, will be confirmed in time to take part in any consideration of the ban.

The ban was set to expire in 90 days, meaning it could run its course before the court would take up the issue.

The US administration also could change the order, including changing its scope or duration.

"We could go on for several more rounds ... but presumably everything would be done very quickly, just as this has happened," David Levine, a law professor at the University of California's Hastings College in San Francisco, told Al Jazeera.

"The US government has several choices. One is that they could go to the Supreme Court in Washington ... to see if they can get a stay. The other thing they can do is try to and get a majority of judges in the 9th Circuit here to agree to review the ruling.

The government has 14 days to ask the 9th Circuit to have a larger panel of judges review the decision "en banc", or appeal directly to the Supreme Court, which will likely determine the case's final outcome.