The ruling late Thursday from a three-judge panel meant that citizens of the seven countries -- Iran, Iraq, Syria, Yemen, Libya, Sudan, Somalia -- will continue to be able to travel to the US, despite Trump's executive order issued on January 27.
The panel, at the US Court of Appeals for the Ninth Circuit, San Francisco, in its decision said the administration had pointed to "no evidence" that anyone from the seven nations had committed terrorism in the US, the New York Times reported.
The ruling also rejected the administration's claim that courts were powerless to review a President's national security determinations.
"It is beyond question," the unsigned decision said, "that the federal judiciary retains the authority to adjudicate constitutional challenges to executive action."
The court acknowledged that Trump was owed deference on his immigration and national security policy determinations, but it said he was asking for something more.
"The government has taken the position," the decision said, "that the president's decisions about immigration policy, particularly when motivated by national security concerns, are unreviewable, even if those actions potentially contravene constitutional rights and protections."
Within minutes of the ruling, Trump angrily vowed to appeal the decision to the Supreme Court.
"See you in court, the security of our nation is at stake!" Trump wrote on Twitter.
He said the ruling was "a political decision" and predicted that his administration would win an appeal "in my opinion, very easily", the New York Times said.
The travel ban, one of the first executive orders Trump issued after taking office on January 20, suspended worldwide refugee entry into the US. It also barred visitors from the seven nations for up to 90 days to give federal security agencies time to impose stricter vetting processes.
Immediately after it was issued, the ban spurred chaos at airports nationwide as hundreds of foreign travellers were stranded at immigration checkpoints.
The State Department said up to 60,000 foreigners' visas had been cancelled in the days immediately after the ban was imposed.
Thursday's decision reviewed a ruling issued on February 3 by Judge James L. Robart, a federal judge in Seattle. Judge Robart blocked the key parts of the order, allowing immigrants and travellers who had been barred entry to come into the US.