A US court has refused to reinstate Donald Trump's ban on travellers from seven predominantly-Muslim nations.

The 9th US Circuit Court of Appeals in San Francisco refused to block a lower-court ruling that suspended the ban and allowed previously-barred travellers to enter the US.

An appeal to the US Supreme Court is possible.

US District Judge James Robart, sitting in Seattle, issued a temporary restraining order halting the ban last week after Washington state and Minnesota sued.

The US Justice Department appealed to the San Francisco court, where government lawyers argued that the ban was a "lawful exercise" of the president's authority and that the seven countries had raised terrorism concerns.

The states said Mr Trump's executive order unconstitutionally blocked entry based on religion.

In its unanimous decision, the appeal court rejected the Trump administration's claim that the court did not have the authority to review the president's executive order.

The panel of three judges noted that Washington and Minnesota had raised serious allegations about religious discrimination.

The court said the government had not shown a likelihood it would succeed in appealing to reinstate the travel ban, nor had it shown that failure to reinstate the ban would cause irreparable injury.

The panel said Washington proved it had the legal right to bring its lawsuit by claiming its universities would suffer harm - one of the questions that the judges considered.

Universities have complained about students and staff becoming stranded overseas.

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

The judges hammered 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.

"I have trouble understanding why we're supposed to infer religious animus when, in fact, the vast majority of Muslims would not be affected," Judge Richard Clifton, a George W Bush nominee, asked a lawyer representing Washington and Minnesota.

Only 15% of the world's Muslims were affected by the executive order, the judge said, citing his own calculations.

"Has the government pointed to any evidence connecting these countries to terrorism?" Judge Michelle Friedland, who was appointed by Barack Obama, asked the Justice Department lawyer.

The lower-court judge 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.

Judge Robart put the executive order on hold while the lawsuit works its way through the courts.

After that ruling, the State Department quickly said people from the seven countries - Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen - with valid visas could travel to the US.

The decision led to tearful reunions at airports round the country.

The Supreme Court has a vacancy and there is no chance Mr 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 administration also could change the order, including changing its scope or duration.

The appeal judges said the government presented no evidence to explain the urgent need for Mr Trump's executive order to take effect immediately and said courts have the authority to review presidential orders on immigration and national security.

Mr Trump took to social media, tweeting: "SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE!"

The appeal court said the government had not pointed to any evidence that anyone from the countries named in the executive order had committed a "terrorist attack" in the US.

The panel said: "Rather than present evidence to explain the need for the executive order, the government has taken the position that we must not review its decision at all.

"We disagree, as explained above."